From 3fa72da4f0538178b891526f4bbddd0d6b6ba8af Mon Sep 17 00:00:00 2001 From: Thibault Deutsch Date: Tue, 10 Mar 2015 01:24:54 +0200 Subject: [PATCH] update README and add badges --- .travis.yml | 1 - AlgoliaSearch.xcodeproj/project.pbxproj | 24 +++-- .../xcschemes/AlgoliaSearch OSX.xcscheme | 2 +- .../xcschemes/AlgoliaSearch iOS.xcscheme | 2 +- README.md | 96 ++++--------------- 5 files changed, 35 insertions(+), 90 deletions(-) diff --git a/.travis.yml b/.travis.yml index c06ebeb14..b78937899 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: objective-c -osx_image: xcode611 env: global: - secure: Joz57OiADTS1+vgoLfNoXkSitwuMtytmAEJeVOdzdp2IKKpWnBBitkIQzaFfOEJmudDaR1CZRd0VpZ+Co1KKSBfl3AsLPWYrzoPNIXgXlxLHuPRSl1h3SFE9xJer9P3klDj3M2o/PZX35xM0+J07T1NjIlP0hmBHnXIJMEbOog4= diff --git a/AlgoliaSearch.xcodeproj/project.pbxproj b/AlgoliaSearch.xcodeproj/project.pbxproj index 1201daab9..fe306c86a 100644 --- a/AlgoliaSearch.xcodeproj/project.pbxproj +++ b/AlgoliaSearch.xcodeproj/project.pbxproj @@ -24,7 +24,7 @@ 5DB251661AADA6EC00945339 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DB251651AADA6EC00945339 /* Alamofire.framework */; }; 5DB251671AADA6F100945339 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DB251651AADA6EC00945339 /* Alamofire.framework */; }; 5DB2516A1AADA70500945339 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DB251681AADA6FE00945339 /* Alamofire.framework */; }; - 5DB2516C1AADF92500945339 /* Alamofire.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5DB251651AADA6EC00945339 /* Alamofire.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 5DB2516C1AADF92500945339 /* Alamofire.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5DB251651AADA6EC00945339 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 5DB2516F1AADF9C000945339 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DB251681AADA6FE00945339 /* Alamofire.framework */; }; 5DECA2DA1A960BC5001A6088 /* Index.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DECA2D91A960BC5001A6088 /* Index.swift */; }; 5DF8C1311A9CA354006E107B /* Type.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DF8C1301A9CA354006E107B /* Type.swift */; }; @@ -285,7 +285,7 @@ 5D7495751A8E25A600B0263F /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastUpgradeCheck = 0620; ORGANIZATIONNAME = Algolia; TargetAttributes = { 5D74957D1A8E25A600B0263F = { @@ -473,7 +473,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -513,7 +513,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.9; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; VERSIONING_SYSTEM = "apple-generic"; @@ -539,7 +539,9 @@ INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = AlgoliaSearch; + SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; @@ -563,7 +565,9 @@ INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_NAME = AlgoliaSearch; + SDKROOT = macosx; SKIP_INSTALL = YES; }; name = Release; @@ -605,7 +609,7 @@ 5DB251511AAD9EE400945339 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = NO; + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEFINES_MODULE = YES; @@ -625,7 +629,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = AlgoliaSearch; - SDKROOT = iphoneos8.1; + SDKROOT = iphoneos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -634,7 +638,7 @@ 5DB251521AAD9EE400945339 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = NO; + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEFINES_MODULE = YES; @@ -650,7 +654,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = AlgoliaSearch; - SDKROOT = iphoneos8.1; + SDKROOT = iphoneos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -672,7 +676,7 @@ "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -690,7 +694,7 @@ "$(PROJECT_DIR)/Carthage/Build/iOS", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; diff --git a/AlgoliaSearch.xcodeproj/xcshareddata/xcschemes/AlgoliaSearch OSX.xcscheme b/AlgoliaSearch.xcodeproj/xcshareddata/xcschemes/AlgoliaSearch OSX.xcscheme index 1beb5c1b2..ee79f501d 100644 --- a/AlgoliaSearch.xcodeproj/xcshareddata/xcschemes/AlgoliaSearch OSX.xcscheme +++ b/AlgoliaSearch.xcodeproj/xcshareddata/xcschemes/AlgoliaSearch OSX.xcscheme @@ -1,6 +1,6 @@ Void in ``` -**Notes:** If you are building a web application, you may be more interested in using our [JavaScript client](https://github.com/algolia/algoliasearch-client-js) to perform queries. It brings two benefits: - * Your users get a better response time by not going through your servers - * It will offload unnecessary tasks from your servers. - -```html - - -``` - @@ -192,16 +172,16 @@ index.search(Query(fullTextQuery: "jim"), block: { (JSON, error) -> Void in Documentation ================ -Check our [online documentation](http://www.algolia.com/doc/guides/): - * [Initial Import](http://www.algolia.com/doc/guides/#InitialImport) - * [Ranking & Relevance](http://www.algolia.com/doc/guides/#RankingRelevance) - * [Indexing](http://www.algolia.com/doc/guides/#Indexing) - * [Search](http://www.algolia.com/doc/guides/#Search) - * [Sorting](http://www.algolia.com/doc/guides/#Sorting) - * [Filtering](http://www.algolia.com/doc/guides/#Filtering) - * [Faceting](http://www.algolia.com/doc/guides/#Faceting) - * [Geo-Search](http://www.algolia.com/doc/guides/#Geo-Search) - * [Security](http://www.algolia.com/doc/guides/#Security) +Check our [online documentation](http://www.algolia.com/doc/guides/swift): + * [Initial Import](http://www.algolia.com/doc/guides/swift#InitialImport) + * [Ranking & Relevance](http://www.algolia.com/doc/guides/swift#RankingRelevance) + * [Indexing](http://www.algolia.com/doc/guides/swift#Indexing) + * [Search](http://www.algolia.com/doc/guides/swift#Search) + * [Sorting](http://www.algolia.com/doc/guides/swift#Sorting) + * [Filtering](http://www.algolia.com/doc/guides/swift#Filtering) + * [Faceting](http://www.algolia.com/doc/guides/swift#Faceting) + * [Geo-Search](http://www.algolia.com/doc/guides/swift#Geo-Search) + * [Security](http://www.algolia.com/doc/guides/swift#Security) * [REST API](http://www.algolia.com/doc/rest) @@ -354,10 +334,6 @@ index.partialUpdateObject(partialObject, objectID: "myID", block: nil) Search ------------- -**Notes:** If you are building a web application, you may be more interested in using our [JavaScript client](https://github.com/algolia/algoliasearch-client-js) to perform queries. It brings two benefits: - * Your users get a better response time by not going through your servers - * It will offload unnecessary tasks from your servers. - To perform a search, you only need to initialize the index and perform a call to the search function. @@ -566,7 +542,10 @@ Delete by query You can delete all objects matching a single query with the following code. Internally, the API client performs the query, deletes all matching hits, and waits until the deletions have been applied. - +```swift +let query: Query = /* [...] */ +index.deleteByQuery(query, block: nil) +``` Index Settings @@ -809,8 +788,6 @@ You can also create an API Key with advanced restrictions: * Add a validity period. The key will be valid for a specific period of time (in seconds). * Specify the maximum number of API calls allowed from an IP address per hour. Each time an API call is performed with this key, a check is performed. If the IP at the source of the call did more than this number of calls in the last hour, a 403 code is returned. Defaults to 0 (no rate limit). This parameter can be used to protect you from attempts at retrieving your entire index contents by massively querying the index. - - * Specify the maximum number of hits this API key can retrieve in one call. Defaults to 0 (unlimited). This parameter can be used to protect you from attempts at retrieving your entire index contents by massively querying the index. * Specify the list of targeted indices. You can target all indices starting with a prefix or ending with a suffix using the '*' character. For example, "dev_*" matches all indices starting with "dev_" and "*_dev" matches all indices ending with "_dev". Defaults to all indices if empty or blank. @@ -883,41 +860,6 @@ index.deleteUserKey("myAPIKey", block: { (JSON, error) -> Void in -You may have a single index containing per user data. In that case, all records should be tagged with their associated user_id in order to add a `tagFilters=(public,user_42)` filter at query time to retrieve only what a user has access to. If you're using the [JavaScript client](http://github.com/algolia/algoliasearch-client-js), it will result in a security breach since the user is able to modify the `tagFilters` you've set by modifying the code from the browser. To keep using the JavaScript client (recommended for optimal latency) and target secured records, you can generate a secured API key from your backend: - - - -This public API key must then be used in your JavaScript code as follow: - -```javascript - -``` - -You can mix rate limits and secured API keys by setting an extra `user_token` attribute both at API key generation time and query time. When set, a unique user will be identified by her `IP + user_token` instead of only by her `IP`. This allows you to restrict a single user to performing a maximum of `N` API calls per hour, even if she shares her `IP` with another user. - - - -This public API key must then be used in your JavaScript code as follow: - -```javascript - -``` - - - Copy or rename an index -------------