Skip to content

Commit 3fa72da

Browse files
committed
update README and add badges
1 parent 4a51262 commit 3fa72da

File tree

5 files changed

+35
-90
lines changed

5 files changed

+35
-90
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
language: objective-c
2-
osx_image: xcode611
32
env:
43
global:
54
- secure: Joz57OiADTS1+vgoLfNoXkSitwuMtytmAEJeVOdzdp2IKKpWnBBitkIQzaFfOEJmudDaR1CZRd0VpZ+Co1KKSBfl3AsLPWYrzoPNIXgXlxLHuPRSl1h3SFE9xJer9P3klDj3M2o/PZX35xM0+J07T1NjIlP0hmBHnXIJMEbOog4=

AlgoliaSearch.xcodeproj/project.pbxproj

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
5DB251661AADA6EC00945339 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DB251651AADA6EC00945339 /* Alamofire.framework */; };
2525
5DB251671AADA6F100945339 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DB251651AADA6EC00945339 /* Alamofire.framework */; };
2626
5DB2516A1AADA70500945339 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DB251681AADA6FE00945339 /* Alamofire.framework */; };
27-
5DB2516C1AADF92500945339 /* Alamofire.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5DB251651AADA6EC00945339 /* Alamofire.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
27+
5DB2516C1AADF92500945339 /* Alamofire.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 5DB251651AADA6EC00945339 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2828
5DB2516F1AADF9C000945339 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DB251681AADA6FE00945339 /* Alamofire.framework */; };
2929
5DECA2DA1A960BC5001A6088 /* Index.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DECA2D91A960BC5001A6088 /* Index.swift */; };
3030
5DF8C1311A9CA354006E107B /* Type.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5DF8C1301A9CA354006E107B /* Type.swift */; };
@@ -285,7 +285,7 @@
285285
5D7495751A8E25A600B0263F /* Project object */ = {
286286
isa = PBXProject;
287287
attributes = {
288-
LastUpgradeCheck = 0610;
288+
LastUpgradeCheck = 0620;
289289
ORGANIZATIONNAME = Algolia;
290290
TargetAttributes = {
291291
5D74957D1A8E25A600B0263F = {
@@ -473,7 +473,7 @@
473473
GCC_WARN_UNUSED_FUNCTION = YES;
474474
GCC_WARN_UNUSED_VARIABLE = YES;
475475
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
476-
MACOSX_DEPLOYMENT_TARGET = 10.10;
476+
MACOSX_DEPLOYMENT_TARGET = 10.9;
477477
MTL_ENABLE_DEBUG_INFO = YES;
478478
ONLY_ACTIVE_ARCH = YES;
479479
SDKROOT = macosx;
@@ -513,7 +513,7 @@
513513
GCC_WARN_UNUSED_FUNCTION = YES;
514514
GCC_WARN_UNUSED_VARIABLE = YES;
515515
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
516-
MACOSX_DEPLOYMENT_TARGET = 10.10;
516+
MACOSX_DEPLOYMENT_TARGET = 10.9;
517517
MTL_ENABLE_DEBUG_INFO = NO;
518518
SDKROOT = macosx;
519519
VERSIONING_SYSTEM = "apple-generic";
@@ -539,7 +539,9 @@
539539
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
540540
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
541541
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
542+
MACOSX_DEPLOYMENT_TARGET = 10.9;
542543
PRODUCT_NAME = AlgoliaSearch;
544+
SDKROOT = macosx;
543545
SKIP_INSTALL = YES;
544546
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
545547
};
@@ -563,7 +565,9 @@
563565
INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist";
564566
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
565567
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
568+
MACOSX_DEPLOYMENT_TARGET = 10.9;
566569
PRODUCT_NAME = AlgoliaSearch;
570+
SDKROOT = macosx;
567571
SKIP_INSTALL = YES;
568572
};
569573
name = Release;
@@ -605,7 +609,7 @@
605609
5DB251511AAD9EE400945339 /* Debug */ = {
606610
isa = XCBuildConfiguration;
607611
buildSettings = {
608-
APPLICATION_EXTENSION_API_ONLY = NO;
612+
APPLICATION_EXTENSION_API_ONLY = YES;
609613
CLANG_ENABLE_MODULES = YES;
610614
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
611615
DEFINES_MODULE = YES;
@@ -625,7 +629,7 @@
625629
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
626630
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
627631
PRODUCT_NAME = AlgoliaSearch;
628-
SDKROOT = iphoneos8.1;
632+
SDKROOT = iphoneos;
629633
SKIP_INSTALL = YES;
630634
TARGETED_DEVICE_FAMILY = "1,2";
631635
};
@@ -634,7 +638,7 @@
634638
5DB251521AAD9EE400945339 /* Release */ = {
635639
isa = XCBuildConfiguration;
636640
buildSettings = {
637-
APPLICATION_EXTENSION_API_ONLY = NO;
641+
APPLICATION_EXTENSION_API_ONLY = YES;
638642
CLANG_ENABLE_MODULES = YES;
639643
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
640644
DEFINES_MODULE = YES;
@@ -650,7 +654,7 @@
650654
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
651655
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
652656
PRODUCT_NAME = AlgoliaSearch;
653-
SDKROOT = iphoneos8.1;
657+
SDKROOT = iphoneos;
654658
SKIP_INSTALL = YES;
655659
TARGETED_DEVICE_FAMILY = "1,2";
656660
VALIDATE_PRODUCT = YES;
@@ -672,7 +676,7 @@
672676
"$(inherited)",
673677
);
674678
INFOPLIST_FILE = Tests/Info.plist;
675-
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
679+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
676680
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
677681
PRODUCT_NAME = "$(TARGET_NAME)";
678682
SDKROOT = iphoneos;
@@ -690,7 +694,7 @@
690694
"$(PROJECT_DIR)/Carthage/Build/iOS",
691695
);
692696
INFOPLIST_FILE = Tests/Info.plist;
693-
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
697+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
694698
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
695699
PRODUCT_NAME = "$(TARGET_NAME)";
696700
SDKROOT = iphoneos;

AlgoliaSearch.xcodeproj/xcshareddata/xcschemes/AlgoliaSearch OSX.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0610"
3+
LastUpgradeVersion = "0620"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

AlgoliaSearch.xcodeproj/xcshareddata/xcschemes/AlgoliaSearch iOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0610"
3+
LastUpgradeVersion = "0620"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

README.md

Lines changed: 19 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ Algolia's Search API makes it easy to deliver a great search experience in your
1919

2020

2121

22-
22+
[![Build Status](https://travis-ci.org/algolia/algoliasearch-client-swift.svg?branch=master)](https://travis-ci.org/algolia/algoliasearch-client-swift)
23+
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
24+
[![](http://img.shields.io/badge/OS%20X-10.9%2B-lightgrey.svg)]()
25+
[![](http://img.shields.io/badge/iOS-8.0%2B-lightgrey.svg)]()
26+
[![GitHub release](https://img.shields.io/github/release/algolia/algoliasearch-client-swift.svg)](https://github.com/algolia/algoliasearch-client-swift/releases/latest)
2327

2428

2529

@@ -158,30 +162,6 @@ index.search(Query(fullTextQuery: "jim"), block: { (JSON, error) -> Void in
158162
```
159163

160164

161-
**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:
162-
* Your users get a better response time by not going through your servers
163-
* It will offload unnecessary tasks from your servers.
164-
165-
```html
166-
<script type="text/javascript" src="//path/to/algoliasearch.min.js"></script>
167-
<script type="text/javascript">
168-
var client = new AlgoliaSearch("YourApplicationID", "YourSearchOnlyAPIKey");
169-
var index = client.initIndex('YourIndexName');
170-
171-
function searchCallback(success, content) {
172-
if (success) {
173-
console.log(content);
174-
}
175-
}
176-
177-
// perform query "jim"
178-
index.search("jim", searchCallback);
179-
180-
// the last optional argument can be used to add search parameters
181-
index.search("jim", searchCallback, { hitsPerPage: 5, facets: '*', maxValuesPerFacet: 10 });
182-
</script>
183-
```
184-
185165

186166

187167

@@ -192,16 +172,16 @@ index.search(Query(fullTextQuery: "jim"), block: { (JSON, error) -> Void in
192172
Documentation
193173
================
194174

195-
Check our [online documentation](http://www.algolia.com/doc/guides/):
196-
* [Initial Import](http://www.algolia.com/doc/guides/#InitialImport)
197-
* [Ranking &amp; Relevance](http://www.algolia.com/doc/guides/#RankingRelevance)
198-
* [Indexing](http://www.algolia.com/doc/guides/#Indexing)
199-
* [Search](http://www.algolia.com/doc/guides/#Search)
200-
* [Sorting](http://www.algolia.com/doc/guides/#Sorting)
201-
* [Filtering](http://www.algolia.com/doc/guides/#Filtering)
202-
* [Faceting](http://www.algolia.com/doc/guides/#Faceting)
203-
* [Geo-Search](http://www.algolia.com/doc/guides/#Geo-Search)
204-
* [Security](http://www.algolia.com/doc/guides/#Security)
175+
Check our [online documentation](http://www.algolia.com/doc/guides/swift):
176+
* [Initial Import](http://www.algolia.com/doc/guides/swift#InitialImport)
177+
* [Ranking &amp; Relevance](http://www.algolia.com/doc/guides/swift#RankingRelevance)
178+
* [Indexing](http://www.algolia.com/doc/guides/swift#Indexing)
179+
* [Search](http://www.algolia.com/doc/guides/swift#Search)
180+
* [Sorting](http://www.algolia.com/doc/guides/swift#Sorting)
181+
* [Filtering](http://www.algolia.com/doc/guides/swift#Filtering)
182+
* [Faceting](http://www.algolia.com/doc/guides/swift#Faceting)
183+
* [Geo-Search](http://www.algolia.com/doc/guides/swift#Geo-Search)
184+
* [Security](http://www.algolia.com/doc/guides/swift#Security)
205185
* [REST API](http://www.algolia.com/doc/rest)
206186

207187

@@ -354,10 +334,6 @@ index.partialUpdateObject(partialObject, objectID: "myID", block: nil)
354334
Search
355335
-------------
356336

357-
**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:
358-
* Your users get a better response time by not going through your servers
359-
* It will offload unnecessary tasks from your servers.
360-
361337

362338
To perform a search, you only need to initialize the index and perform a call to the search function.
363339

@@ -566,7 +542,10 @@ Delete by query
566542
567543
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.
568544
569-
545+
```swift
546+
let query: Query = /* [...] */
547+
index.deleteByQuery(query, block: nil)
548+
```
570549
571550
572551
Index Settings
@@ -809,8 +788,6 @@ You can also create an API Key with advanced restrictions:
809788
* Add a validity period. The key will be valid for a specific period of time (in seconds).
810789
* 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.
811790
812-
813-
814791
* 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.
815792
* 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.
816793
@@ -883,41 +860,6 @@ index.deleteUserKey("myAPIKey", block: { (JSON, error) -> Void in
883860
884861
885862
886-
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:
887-
888-
889-
890-
This public API key must then be used in your JavaScript code as follow:
891-
892-
```javascript
893-
<script type="text/javascript">
894-
var algolia = new AlgoliaSearch('YourApplicationID', '<%= public_api_key %>');
895-
algolia.setSecurityTags('(public,user_42)'); // must be same than those used at generation-time
896-
algolia.initIndex('YourIndex').search($('#q').val(), function(success, content) {
897-
// [...]
898-
});
899-
</script>
900-
```
901-
902-
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.
903-
904-
905-
906-
This public API key must then be used in your JavaScript code as follow:
907-
908-
```javascript
909-
<script type="text/javascript">
910-
var algolia = new AlgoliaSearch('YourApplicationID', '<%= public_api_key %>');
911-
algolia.setSecurityTags('(public,user_42)'); // must be same than those used at generation-time
912-
algolia.setUserToken('user_42') // must be same than the one used at generation-time
913-
algolia.initIndex('YourIndex').search($('#q').val(), function(success, content) {
914-
// [...]
915-
});
916-
</script>
917-
```
918-
919-
920-
921863
Copy or rename an index
922864
-------------
923865

0 commit comments

Comments
 (0)