Skip to content

Commit 2d184c1

Browse files
author
Xavier Grand
committed
Update documentation with the last features
1 parent 796ec2c commit 2d184c1

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

README.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ Table of Contents
2929

3030
**Commands Reference**
3131

32-
1. [Add a new object](#add-a-new-object-in-the-index)
32+
1. [Add a new object](#add-a-new-object-to-the-index)
3333
1. [Update an object](#update-an-existing-object-in-the-index)
3434
1. [Search](#search)
35+
1. [Multiple queries](#multiple-queries)
3536
1. [Get an object](#get-an-object)
3637
1. [Delete an object](#delete-an-object)
3738
1. [Delete by query](#delete-by-query)
@@ -43,13 +44,12 @@ Table of Contents
4344
1. [Batch writes](#batch-writes)
4445
1. [Security / User API Keys](#security--user-api-keys)
4546
1. [Copy or rename an index](#copy-or-rename-an-index)
46-
1. [Backup / Retrieve all index content](#backup--retrieve-all-index-content)
47+
1. [Backup / Retrieve all index content](#backup--retrieve-of-all-index-content)
4748
1. [Logs](#logs)
4849

4950

5051

5152

52-
5353
Setup
5454
-------------
5555
To setup your project, follow these steps:
@@ -68,15 +68,10 @@ let client = AlgoliaSearch.Client(appID: "YourApplicationID", apiKey: "YourAPIKe
6868

6969

7070

71-
72-
73-
74-
75-
76-
7771
Quick Start
7872
-------------
7973

74+
8075
In 30 seconds, this quick start tutorial will show you how to index and search objects.
8176

8277
Without any prior configuration, you can start indexing [500 contacts](https://github.com/algolia/algoliasearch-client-csharp/blob/master/contacts.json) in the ```contacts``` index using the following code:
@@ -158,13 +153,8 @@ index.search(Query(fullTextQuery: "jim"), block: { (JSON, error) -> Void in
158153

159154

160155

161-
162-
163-
164-
165156
Documentation
166157
================
167-
168158
Check our [online documentation](http://www.algolia.com/doc/guides/swift):
169159
* [Initial Import](http://www.algolia.com/doc/guides/swift#InitialImport)
170160
* [Ranking & Relevance](http://www.algolia.com/doc/guides/swift#RankingRelevance)
@@ -177,7 +167,6 @@ Check our [online documentation](http://www.algolia.com/doc/guides/swift):
177167
* [Security](http://www.algolia.com/doc/guides/swift#Security)
178168
* [REST API](http://www.algolia.com/doc/rest)
179169

180-
181170
Tutorials
182171
================
183172

@@ -193,8 +182,6 @@ Commands Reference
193182

194183

195184

196-
197-
198185
Add a new object to the Index
199186
-------------
200187

@@ -322,8 +309,6 @@ let partialObject = ["price": operation]
322309
index.partialUpdateObject(partialObject, objectID: "myID", block: nil)
323310
```
324311

325-
326-
327312
Search
328313
-------------
329314

@@ -486,6 +471,10 @@ client.multipleQueries(queries, block: { (JSON, error) -> Void in
486471
})
487472
```
488473
474+
You can specify a strategy to optimize your multiple queries:
475+
- **none**: Execute the sequence of queries until the end.
476+
- **stopIfEnoughMatches**: Execute the sequence of queries until the number of hits is reached by the sum of hits.
477+
489478
490479
491480
Get an object
@@ -510,18 +499,12 @@ index.getObject("myID", attributesToRetrieve: ["firstname"], block: { (JSON, err
510499
511500
You can also retrieve a set of objects:
512501
513-
514502
```swift
515503
index.getObjects(["myID1", "myID2"], block: { (JSON, error) -> {
516504
// do something
517505
})
518506
```
519507
520-
521-
522-
523-
524-
525508
Delete an object
526509
-------------
527510
@@ -553,8 +536,8 @@ You can retrieve all settings using the `` function. The result will contain the
553536
* **attributesToIndex**: (array of strings) The list of fields you want to index.<br/>If set to null, all textual and numerical attributes of your objects are indexed. Be sure to update it to get optimal results.<br/>This parameter has two important uses:
554537
* *Limit the attributes to index*.<br/>For example, if you store a binary image in base64, you want to store it and be able to retrieve it, but you don't want to search in the base64 string.
555538
* *Control part of the ranking*.<br/>(see the ranking parameter for full explanation) Matches in attributes at the beginning of the list will be considered more important than matches in attributes further down the list. In one attribute, matching text at the beginning of the attribute will be considered more important than text after. You can disable this behavior if you add your attribute inside `unordered(AttributeName)`. For example, `attributesToIndex: ["title", "unordered(text)"]`.
556-
**Notes**: All numerical attributes are automatically indexed as numerical filters. If you don't need filtering on some of your numerical attributes, please consider sending them as strings to speed up the indexing.<br/>
557539
You can decide to have the same priority for two attributes by passing them in the same string using a comma as a separator. For example `title` and `alternative_title` have the same priority in this example, which is different than text priority: `attributesToIndex:["title,alternative_title", "text"]`.
540+
* **numericAttributesToIndex**: (array of strings) All numerical attributes are automatically indexed as numerical filters. If you don't need filtering on some of your numerical attributes, you can specify this list to speed up the indexing.<br/> If you only need to filter on a numeric value with the operator '=', you can speed up the indexing by specifying the attribute with `equalOnly(AttributeName)`. The other operators will be disabled.
558541
* **attributesForFaceting**: (array of strings) The list of fields you want to use for faceting. All strings in the attribute selected for faceting are extracted and added as a facet. If set to null, no attribute is used for faceting.
559542
* **attributeForDistinct**: The attribute name used for the `Distinct` feature. This feature is similar to the SQL "distinct" keyword. When enabled in queries with the `distinct=1` parameter, all hits containing a duplicate value for this attribute are removed from results. For example, if the chosen attribute is `show_name` and several hits have the same value for `show_name`, then only the best one is kept and others are removed. **Note**: This feature is disabled if the query string is empty and there aren't any `tagFilters`, `facetFilters`, nor `numericFilters` parameters.
560543
* **ranking**: (array of strings) Controls the way results are sorted.<br/>We have nine available criteria:
@@ -726,6 +709,17 @@ index.partialUpdateObjects([obj1, obj2], block: { (JSON, error) -> Void in
726709
727710
728711
712+
If you have one index per user, you may want to perform a batch operations across severals indexes.
713+
We expose a method to perform this type of batch:
714+
715+
716+
The attribute **action** can have these values:
717+
- addObject
718+
- updateObject
719+
- partialUpdateObject
720+
- partialUpdateObjectNoCreate
721+
- deleteObject
722+
729723
Security / User API Keys
730724
-------------
731725
@@ -778,13 +772,17 @@ index.addUserKey(["search"], block: { (JSON, error) -> Void in
778772
})
779773
```
780774
781-
You can also create an API Key with advanced restrictions:
775+
You can also create an API Key with advanced settings:
782776
783777
* Add a validity period. The key will be valid for a specific period of time (in seconds).
784778
* 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.
785779
786780
* 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.
787781
* 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.
782+
* Specify the list of referers. You can target all referers starting with a prefix or ending with a suffix using the '*' character. For example, "algolia.com/*" matches all referers starting with "algolia.com/" and "*.algolia.com" matches all referers ending with ".algolia.com". Defaults to all referers if empty or blank.
783+
* Specify the list of query parameters. You can force the query parameters for a query using the url string format (param1=X&param2=Y...).
784+
* Specify a description to describe where the key is used.
785+
788786
789787
```swift
790788
// Creates a new global API key that is valid for 300 seconds
@@ -965,4 +963,3 @@ client.getLogsWithOffset(0, length: 100, block: { (JSON, error) -> Void in
965963
966964
967965
968-

0 commit comments

Comments
 (0)