Skip to content

Commit

Permalink
update README and add badges
Browse files Browse the repository at this point in the history
  • Loading branch information
dethi committed Mar 9, 2015
1 parent 4a51262 commit 3fa72da
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 90 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
language: objective-c
osx_image: xcode611
env:
global:
- secure: Joz57OiADTS1+vgoLfNoXkSitwuMtytmAEJeVOdzdp2IKKpWnBBitkIQzaFfOEJmudDaR1CZRd0VpZ+Co1KKSBfl3AsLPWYrzoPNIXgXlxLHuPRSl1h3SFE9xJer9P3klDj3M2o/PZX35xM0+J07T1NjIlP0hmBHnXIJMEbOog4=
Expand Down
24 changes: 14 additions & 10 deletions AlgoliaSearch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -285,7 +285,7 @@
5D7495751A8E25A600B0263F /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
LastUpgradeCheck = 0620;
ORGANIZATIONNAME = Algolia;
TargetAttributes = {
5D74957D1A8E25A600B0263F = {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand All @@ -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";
};
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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";
};
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
LastUpgradeVersion = "0620"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
LastUpgradeVersion = "0620"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
96 changes: 19 additions & 77 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ Algolia's Search API makes it easy to deliver a great search experience in your




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



Expand Down Expand Up @@ -158,30 +162,6 @@ index.search(Query(fullTextQuery: "jim"), block: { (JSON, error) -> 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
<script type="text/javascript" src="//path/to/algoliasearch.min.js"></script>
<script type="text/javascript">
var client = new AlgoliaSearch("YourApplicationID", "YourSearchOnlyAPIKey");
var index = client.initIndex('YourIndexName');
function searchCallback(success, content) {
if (success) {
console.log(content);
}
}
// perform query "jim"
index.search("jim", searchCallback);
// the last optional argument can be used to add search parameters
index.search("jim", searchCallback, { hitsPerPage: 5, facets: '*', maxValuesPerFacet: 10 });
</script>
```




Expand All @@ -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 &amp; 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 &amp; 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)


Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
<script type="text/javascript">
var algolia = new AlgoliaSearch('YourApplicationID', '<%= public_api_key %>');
algolia.setSecurityTags('(public,user_42)'); // must be same than those used at generation-time
algolia.initIndex('YourIndex').search($('#q').val(), function(success, content) {
// [...]
});
</script>
```
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
<script type="text/javascript">
var algolia = new AlgoliaSearch('YourApplicationID', '<%= public_api_key %>');
algolia.setSecurityTags('(public,user_42)'); // must be same than those used at generation-time
algolia.setUserToken('user_42') // must be same than the one used at generation-time
algolia.initIndex('YourIndex').search($('#q').val(), function(success, content) {
// [...]
});
</script>
```
Copy or rename an index
-------------
Expand Down

0 comments on commit 3fa72da

Please sign in to comment.