algolia / algoliasearch-client-swift Goto Github PK
View Code? Open in Web Editor NEW⚡️ A fully-featured and blazing-fast Swift API client to interact with Algolia.
License: MIT License
⚡️ A fully-featured and blazing-fast Swift API client to interact with Algolia.
License: MIT License
Hi!
Is there any reason why your library couldn't work on watchOS?
It does not make sense to have client methods for requests requiring an admin API key, as this key should remain on the back-end.
So we should remove:
It would be great to be able to customize the cache to use things like NSURLRequestReturnCacheDataElseLoad
which allows me to at least show something to the user when their device is offline, regardless of age or expiration. For example, my app shows a list of movie reviews. If the user starts reading a review but leaves and comes back later to finish reading (this time their device is offline), I would love to still be able to show them the same content they were viewing last time they were online. Is this something you would consider adding as an option?
Hi,
github "algolia/algoliasearch-client-swift" == 2.1.0
carthage update --platform iOS
When I build and run my project on the device everything is ok
If I try to build my project on the simulator it's generate some errors:
ld: warning: ignoring file .../Build/Products/Debug-iphonesimulator/AlgoliaSearch.framework/AlgoliaSearch, file was built for i386 which is not the architecture being linked (x86_64): .../Build/Products/Debug-iphonesimulator/AlgoliaSearch.framework/AlgoliaSearch
...
Undefined symbols for architecture x86_64:
"AlgoliaSearch.Client.(init (AlgoliaSearch.Client.Type) -> (appID : Swift.String, apiKey : Swift.String, queryParameters : Swift.String?, tagFilters : Swift.String?, userToken : Swift.String?, hostnames : [Swift.String]?) -> AlgoliaSearch.Client).(default argument 4)", referenced from:
TestAlgolia.Test.init (TestAlgolia.Test.Type)() -> TestAlgolia.Test in Test.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Since the Swift client is meant to be called from Objective-C, unit tests in Objective-C seem necessary to confirm that the bridging works properly.
I am using pod 'AlgoliaSearch-Client-Swift', '~> 1.4', all working well with swift 1.2. But as soon as I shifted to Xcode 7, it raised error in "Network.swift" and "Index.swift". Is anyone facing the same problem? or could anyone guide me to resolve this issue?
Hi,
After installed Xcode 7.3 when I build with Carthage I have a lot of warnings:
warning: 'var' parameters are deprecated and will be removed in Swift 3
warning: '++' is deprecated: it will be removed in Swift 3
warning: keyword 'protocol' does not need to be escaped in argument list
warning: use of 'typealias' to declare associated types is deprecated; use 'associatedtype' instead
I am having difficulty finding numericFilters in the 3.0 SDK..
I used to be able to do a query with a numericFilter to find an record with a specific number.
cancelQueries()
method.(OS X 10.11) is not compatible with AlgoliaSearch-Client-Swift (3.2)
, which does not support osx
.
As per Apple's documentation of NSURLSession
:
Session objects make a copy of the configuration settings you provide and use those settings to configure the session. Once configured, the session object ignores any changes you make to the
NSURLSessionConfiguration
object.
So what we do in the Client
class is likely broken.
The tutorials in the documentation refer to web projects not IOS. is there a link to IOS projects?
Hi,
I contacted support today about strategy parameter in multiple query, I didn't understand its behavior because it's actually not working as expected and documentation was wrong apparently.
It's should be passed as POST parameter. Here is the temp fix I did on my side:
#87
You can reproduce by setting the strategy to "stopIfEnoughMatches", if you reach the number of hits of the first query for example, you'll also get hits for other queries, so the parameter is not taken.
Thanks !
The new conventions being an array of components separated by semicolons:
Algolia for $LANGUAGE ($VERSION1); Library X ($VERSION2); Library Y ($VERSION2)
We should make it easily configurable, so that the future helpers can easily add their version to the list without destroying anything.
Hi,
Following Algolia Search with Carthage:
carthage version
: 0.16.2xcodebuild -version
: Xcode 7.3.1 Build version 7D1014--no-build
? No--no-use-binaries
? No--use-submodules
? NoCartfile
github "algolia/algoliasearch-client-swift" == 3.2.1
Cartage Output
$ carthage update --platform iOS
*** Cloning algoliasearch-client-swift
*** Checking out algoliasearch-client-swift at "3.2.1"
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
ld: warning: embedded dylibs/frameworks only run on iOS 8 or later
I don't have those warnings with Algolia Search version 2.3. Something must be wrong configured in your project.
Hi there,
Is there a way to cancel requests?
I could only find the following internal method in the Client:
/// Cancel a queries. Only the last ten queries can be cancelled.
func cancelQueries(method: HTTPMethod, path: String) {
for request in requestBuffer {
if request.request.URL!.path! == path {
if request.request.HTTPMethod == method.rawValue {
request.cancel()
}
}
}
}
Is there or are there plans to implement public methods for cancelling requests?
Thank you for your help.
Hi!
I am using the public func getObject(objectID: String, block: CompletionHandler)
my "content" result is a JSON result, however, I am getting a compiler warning with Swift 2.1
let foundObject = content as! NSDictionary
"Cast from '[String: AnyObject]?' to unrelated type 'NSDictionary' always fails"
Any ideas?
I found typoTolerance as an enum in Query.. but can not find advancedSyntax? Any ideas?
That's something we do in other clients. It can be useful when the user already has a background thread which she uses to perform operations. In this case, synchronous calls lead to more straightforward code while not degrading end-user performance.
I think we should rename fullTextQuery
to query
to fit the other API clients & the REST API.
Is it possible to deprecate it and to be backward compliant?
Currently, completion handlers are run on the main thread. This eases the implementation in simple cases, but when the completion handler performs costly computation, it actually makes things more complicated. In those cases, it would be easier if the completion handler ran on a background queue, and it were up to the client code to dispatch to the main thread. (By the way, this is what system-provided asynchronous methods do; e.g. NSURLSession.dataTaskWithURL(_:completionHandler:)
.)
Unfortunately, we cannot change the default behavior without breaking client code. But what about providing an option (at the client level) to run completion handlers in the background?
There is an exception thrown when searching on an index with spaces on its name (e.g. "Index with space").
The solution is correctly implementing Helpers class's urlEncode() function:
Current implementation:
func urlEncode() -> String {
let customAllowedSet = NSCharacterSet(charactersInString: "!*'();:@&=+$,/?%#[]").invertedSet
return stringByAddingPercentEncodingWithAllowedCharacters(customAllowedSet)!
}
Proposed solution:
func urlEncode() -> String {
return stringByAddingPercentEncodingWithAllowedCharacters(.URLHostAllowedCharacterSet())!
}
It would be nice to have optionals for every parameter... but value types optionals are not bridgeable to Objective-C. We should therefore maybe use NSNumber
, but it's not as nice for Swift clients. Should we provide two flavours of each value type property?
Seems to work on master
.
Will have PR shortly
Hi!
What is the roadmap / plan for Swift 2.3 & 3 conversion?
I've added the pod to my pod file and when I try to do a pod install I get the following error message in terminal.
[!] The platform of the target AppName-tvOS
(tvOS 9.0) is not compatible with AlgoliaSearch-Client-Swift (3.3)
, which does not support tvos
.
The only non-iOS 7 compliant part of the code seems to be setting the underlyingQueue
on the Client
's operation queue... which appears to be unused.
WARNING: Simulators below iOS 8.1 are not provided by Xcode 7.3, so the iOS 7 code will remain untested.
Refs #62.
The goal is to systematically avoid overloading the first non-DSN host upon failure. Shuffling should be done once and for all, as retrying a different host every time would likely imply opening a new connection, therefore incur a big overhead. Randomization across all users should be enough to guarantee proper load balancing.
Currently, we are passing the queries as a completely untyped array, but we still require each item to be a dictionary with two keys: index name and query object. A more strongly typed argument would be welcome, for example like the IndexQuery
class used on Android.
Implement this helper, like in other API clients.
Invalid Info.plist value. The value for the key 'MinimumOSVersion' in bundle MyApp.app/Frameworks/AlgoliaSearch.framework is invalid. The minimum value is 8.0
It's currently not possible to submit an app that uses algoliasearch-client-swift via Carthage, because when the the framework is built via Carthage minimumosversion is set to 7.0, however it must be 8.0 or higher.
Hi! Can we test this in travis, is that feasible?
Hi,
With Swift 3 it would also be nice to add support for SwiftPM
Articles about SwiftPM:
On your README.md
add on top and add section for the installation with SwiftPM.
Likewise, the type alias Serializer
should be renamed.
Under some circumstances, callbacks can receive both a nil result and a nil error. (Example in the Manager
class.)
-> One of them should be provided at all times.
Use the algolia.biz
domain name, which accepts anything... and times out everything. 😄
Apparently the new Synonyms API hasn't been integrated in the Swift SDK?
Batch requests are used behind the scenes in a few methods, but there is currently no generic way to issue a batch request. -> Implement it.
I have tried installing via Cocapods and get the following error when trying to import Algolia.
Any ideas how to get it working?
Have tried cleaning the project.
Here is the Pod file:
# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'Algolia' do
pod 'AlgoliaSearch-Client-Swift', '~> 1.4'
end
We can set the X-Algolia-TagFilters
and the X-Algolia-UserToken
header, but the new X-Algolia-QueryParameters
is missing.
We could probably create something like:
let client = AlgoliaSearch.Client(appID: "xxxxxxx", apiKey: "xxxxxxxxxxxxx", queryParameters:"tagFilters=xxxxxxxx")
Would you mind adding a tvOS target? I was able to and it seem to work fine.
Please add Carthage support.
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.