Skip to content

Commit 4179252

Browse files
docs(README): automatic update
Update README Python [This list might not be relevant] refactor: Renaming attributes (#132) * refactor: Renaming attributes Specifically, this commit replaces: - attributesToIndex with searchableAttributes - numericAttributesToIndex with numericAttributesForFiltering * refactor: Renaming `forwardToSlaves` into `forwardToReplicas` * Display legacy names in parameter descriptions Settings: Fix `indexing` scope instead of `settings` (#139) [ci skip]
1 parent 4e62d0b commit 4179252

File tree

1 file changed

+35
-32
lines changed

1 file changed

+35
-32
lines changed

README.md

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ index.set_settings({"customRanking": ["desc(followers)"]})
192192
You can also configure the list of attributes you want to index by order of importance (first = most important):
193193

194194
```python
195-
index.set_settings({"attributesToIndex": ["lastname", "firstname", "company",
195+
index.set_settings({"searchableAttributes": ["lastname", "firstname", "company",
196196
"email", "city", "address"]})
197197
```
198198

@@ -760,9 +760,9 @@ index.set_settings({"customRanking": ["desc(followers)"]})
760760

761761
Performance wise, it's better to do a `` before pushing the data
762762

763-
#### Slave settings
763+
#### Replica settings
764764

765-
You can forward all settings updates to the slaves of an index by using the `forwardToSlaves` option:
765+
You can forward all settings updates to the replicas of an index by using the `forwardToReplicas` option:
766766

767767
```python
768768
index.set_settings({"customRanking": ["desc(followers)"]}, True)
@@ -774,14 +774,14 @@ index.set_settings({"customRanking": ["desc(followers)"]}, True)
774774

775775
<!--PARAMETERS_LINK-->
776776

777-
Here is the list of parameters you can use with the set settings method (`indexing` [scope](#scope))
777+
Here is the list of parameters you can use with the set settings method (`settings` [scope](#scope)).
778778

779779

780-
Parameters that can be overridden at search time also have the `search` [scope](#scope)
780+
Parameters that can be overridden at search time also have the `search` [scope](#scope).
781781

782782
**Attributes**
783783

784-
- [attributesToIndex](#attributestoindex) `settings`
784+
- [searchableAttributes](#searchableattributes) `settings`
785785
- [attributesForFaceting](#attributesforfaceting) `settings`
786786
- [attributesToRetrieve](#attributestoretrieve) `settings`, `search`
787787
- [unretrievableAttributes](#unretrievableattributes) `settings`
@@ -790,7 +790,7 @@ Parameters that can be overridden at search time also have the `search` [scope](
790790

791791
- [ranking](#ranking) `settings`
792792
- [customRanking](#customranking) `settings`
793-
- [slaves](#slaves) `settings`
793+
- [replicas](#replicas) `settings`
794794

795795
**Filtering / Faceting**
796796

@@ -834,7 +834,7 @@ Parameters that can be overridden at search time also have the `search` [scope](
834834

835835
- [attributeForDistinct](#attributefordistinct) `settings`
836836
- [distinct](#distinct) `settings`, `search`
837-
- [numericAttributesToIndex](#numericattributestoindex) `settings`
837+
- [numericAttributesForFiltering](#numericattributesforfiltering) `settings`
838838
- [allowCompressionOfIntegerArray](#allowcompressionofintegerarray) `settings`
839839
- [altCorrections](#altcorrections) `settings`
840840
- [placeholders](#placeholders) `settings`
@@ -866,7 +866,7 @@ They are three scopes:
866866

867867
**Attributes**
868868

869-
- [attributesToIndex](#attributestoindex) `settings`
869+
- [searchableAttributes](#searchableattributes) `settings`
870870
- [attributesForFaceting](#attributesforfaceting) `settings`
871871
- [unretrievableAttributes](#unretrievableattributes) `settings`
872872
- [attributesToRetrieve](#attributestoretrieve) `settings`, `search`
@@ -876,7 +876,7 @@ They are three scopes:
876876

877877
- [ranking](#ranking) `settings`
878878
- [customRanking](#customranking) `settings`
879-
- [slaves](#slaves) `settings`
879+
- [replicas](#replicas) `settings`
880880

881881
**Filtering / Faceting**
882882

@@ -937,7 +937,7 @@ They are three scopes:
937937
- [attributeForDistinct](#attributefordistinct) `settings`
938938
- [distinct](#distinct) `settings`, `search`
939939
- [getRankingInfo](#getrankinginfo) `search`
940-
- [numericAttributesToIndex](#numericattributestoindex) `settings`
940+
- [numericAttributesForFiltering](#numericattributesforfiltering) `settings`
941941
- [allowCompressionOfIntegerArray](#allowcompressionofintegerarray) `settings`
942942
- [numericFilters (deprecated)](#numericfilters-deprecated) `search`
943943
- [tagFilters (deprecated)](#tagfilters-deprecated) `search`
@@ -963,11 +963,12 @@ The instant search query string, used to set the string you want to search in yo
963963

964964
### Attributes
965965

966-
#### attributesToIndex
966+
#### searchableAttributes
967967

968968
- scope: `settings`
969969
- type: `array of strings`
970970
- default: `*`
971+
- formerly known as: `attributesToIndex`
971972

972973

973974
The list of attributes you want index (i.e. to make searchable).
@@ -979,7 +980,7 @@ This parameter has two important uses:
979980

980981
1. **Limit the attributes to index.** For example, if you store the URL of a picture, you want to store it and be able to retrieve it, but you probably don't want to search in the URL.
981982

982-
2. **Control part of the ranking.** The contents of the `attributesToIndex` parameter impacts ranking in two complementary ways:
983+
2. **Control part of the ranking.** The contents of the `searchableAttributes` parameter impacts ranking in two complementary ways:
983984

984985
First, the order in which attributes are listed defines their ranking priority: matches in attributes at the beginning of the list will be considered more important than matches in attributes further down the list. To assign the same priority to several attributes, pass them within the same string, separated by commas. For example, by specifying `["title,"alternative_title", "text"]`, `title` and `alternative_title` will have the same priority, but a higher priority than `text`.
985986

@@ -1034,13 +1035,13 @@ You can also use `*` to retrieve all values when an **attributesToRetrieve** set
10341035

10351036
- scope: `search`
10361037
- type: `array of strings`
1037-
- default: `attributesToIndex`
1038+
- default: `searchableAttributes`
10381039

10391040

1040-
List of attributes you want to use for textual search (must be a subset of the `attributesToIndex` index setting).
1041+
List of attributes you want to use for textual search (must be a subset of the `searchableAttributes` index setting).
10411042
Attributes are separated with a comma such as `"name,address"`.
10421043
You can also use JSON string array encoding such as `encodeURIComponent("[\"name\",\"address\"]")`.
1043-
By default, all attributes specified in the `attributesToIndex` settings are used to search.
1044+
By default, all attributes specified in the `searchableAttributes` settings are used to search.
10441045

10451046

10461047
### Ranking
@@ -1060,7 +1061,7 @@ We have nine available criterion:
10601061
* `geo`: Sort according to decreasing distance when performing a geo location based search.
10611062
* `words`: Sort according to the number of query words matched by decreasing order. This parameter is useful when you use the `optionalWords` query parameter to have results with the most matched words first.
10621063
* `proximity`: Sort according to the proximity of the query words in hits.
1063-
* `attribute`: Sort according to the order of attributes defined by attributesToIndex.
1064+
* `attribute`: Sort according to the order of attributes defined by searchableAttributes.
10641065
* `exact`:
10651066
* If the user query contains one word: sort objects having an attribute that is exactly the query word before others. For example, if you search for the TV show "V", you want to find it with the "V" query and avoid getting all popular TV shows starting by the letter V before it.
10661067
* If the user query contains multiple words: sort according to the number of words that matched exactly (not as a prefix).
@@ -1088,11 +1089,12 @@ For example, `"customRanking" => ["desc(population)", "asc(name)"]`.
10881089
To get a full description of how the Custom Ranking works,
10891090
you can have a look at our [Ranking guide](https://www.algolia.com/doc/guides/relevance/ranking).
10901091

1091-
#### slaves
1092+
#### replicas
10921093

10931094
- scope: `settings`
10941095
- type: `array of strings`
10951096
- default: `[]`
1097+
- formerly known as: `slaves`
10961098

10971099

10981100
The list of indices on which you want to replicate all write operations.
@@ -1103,7 +1105,7 @@ If you want to use different ranking configurations depending of the use case,
11031105
you need to create one index per ranking configuration.
11041106

11051107
This option enables you to perform write operations only on this index and automatically
1106-
update slave indices with the same operations.
1108+
update replica indices with the same operations.
11071109

11081110
### Filtering / Faceting
11091111

@@ -1375,7 +1377,7 @@ If set to true, plural won't be considered as a typo. For example, car and cars,
13751377

13761378

13771379
List of attributes on which you want to disable typo tolerance
1378-
(must be a subset of the `attributesToIndex` index setting).
1380+
(must be a subset of the `searchableAttributes` index setting).
13791381

13801382
Attributes are separated with a comma such as `"name,address"`.
13811383
You can also use JSON string array encoding such as `encodeURIComponent("[\"name\",\"address\"]")`.
@@ -1633,7 +1635,7 @@ For most use cases, it is better to not use this feature as people search by key
16331635

16341636

16351637
List of attributes on which you want to disable prefix matching
1636-
(must be a subset of the `attributesToIndex` index setting).
1638+
(must be a subset of the `searchableAttributes` index setting).
16371639

16381640
This setting is useful on attributes that contain string that should not be matched as a prefix
16391641
(for example a product SKU).
@@ -1647,7 +1649,7 @@ This setting is useful on attributes that contain string that should not be matc
16471649

16481650

16491651
List of attributes on which you want to disable the computation of `exact` criteria
1650-
(must be a subset of the `attributesToIndex` index setting).
1652+
(must be a subset of the `searchableAttributes` index setting).
16511653

16521654
#### exactOnSingleWordQuery
16531655

@@ -1727,11 +1729,12 @@ you can have a look at our [guide on distinct](https://www.algolia.com/doc/searc
17271729
If set to true,
17281730
the result hits will contain ranking information in the **_rankingInfo** attribute.
17291731

1730-
#### numericAttributesToIndex
1732+
#### numericAttributesForFiltering
17311733

17321734
- scope: `settings`
17331735
- type: `array of strings`
17341736
- default: ``
1737+
- formerly known as: `numericAttributesToIndex`
17351738

17361739

17371740
All numerical attributes are automatically indexed as numerical filters
@@ -1994,21 +1997,21 @@ The move_index method will overwrite the destination index, and delete the tempo
19941997
**Warning**
19951998

19961999
The move_index operation will override all settings of the destination,
1997-
There is one exception for the [slaves](#slaves) parameter which is not impacted.
2000+
There is one exception for the [replicas](#replicas) parameter which is not impacted.
19982001

19992002
For example, if you want to fully update your index `MyIndex` every night, we recommend the following process:
20002003

20012004
1. Get settings and synonyms from the old index using [Get settings](#get-settings---get_settings)
20022005
and [Get synonym](#get-synonym---get_synonym).
20032006
1. Apply settings and synonyms to the temporary index `MyTmpIndex`, (this will create the `MyTmpIndex` index)
20042007
using [Set settings](#set-settings) and [Batch synonyms](#batch-synonyms---batch_synonyms)
2005-
(make sure to remove the [slaves](#slaves) parameter from the settings if it exists).
2008+
(make sure to remove the [replicas](#replicas) parameter from the settings if it exists).
20062009
1. Import your records into a new index using [Add objects](#add-objects---add_objects).
20072010
1. Atomically replace the index `MyIndex` with the content and settings of the index `MyTmpIndex`
20082011
using the [Move index](#move-index---move_index) method.
20092012
This will automatically override the old index without any downtime on the search.
20102013
1. You'll end up with only one index called `MyIndex`, that contains the records and settings pushed to `MyTmpIndex`
2011-
and the slave-indices that were initially attached to `MyIndex` will be in sync with the new data.
2014+
and the replica-indices that were initially attached to `MyIndex` will be in sync with the new data.
20122015

20132016

20142017

@@ -2174,7 +2177,7 @@ public_key = client.generate_secured_api_key('YourSearchOnlyApiKey', {'restrictS
21742177

21752178
This method saves a single synonym record into the index.
21762179

2177-
In this example, we specify true to forward the creation to slave indices.
2180+
In this example, we specify true to forward the creation to replica indices.
21782181
By default the behavior is to save only on the specified index.
21792182

21802183
```python
@@ -2188,7 +2191,7 @@ index.save_synonym({
21882191
### Batch synonyms - `batch_synonyms`
21892192

21902193
Use the batch method to create a large number of synonyms at once,
2191-
forward them to slave indices if desired,
2194+
forward them to replica indices if desired,
21922195
and optionally replace all existing synonyms
21932196
on the index with the content of the batch using the replaceExistingSynonyms parameter.
21942197

@@ -2197,7 +2200,7 @@ on a production index. This is the only way to ensure the index always
21972200
has a full list of synonyms to use during the indexing of the new list.
21982201

21992202
```python
2200-
# Batch synonyms, with slave forwarding and atomic replacement of existing synonyms
2203+
# Batch synonyms, with replica forwarding and atomic replacement of existing synonyms
22012204
index.batch_synonyms([{
22022205
'objectID': 'a-unique-identifier',
22032206
'type': 'synonym',
@@ -2224,10 +2227,10 @@ in the batch update.
22242227

22252228
Use the normal index delete method to delete synonyms,
22262229
specifying the objectID of the synonym record you want to delete.
2227-
Forward the deletion to slave indices by setting the forwardToSlaves parameter to true.
2230+
Forward the deletion to replica indices by setting the forwardToReplicas parameter to true.
22282231

22292232
```python
2230-
# Delete and forward to slaves
2233+
# Delete and forward to replicas
22312234
index.delete_synonym('a-unique-identifier', True)
22322235
```
22332236

@@ -2242,7 +2245,7 @@ To atomically replace all synonyms of an index,
22422245
use the batch method with the replaceExistingSynonyms parameter set to true.
22432246

22442247
```python
2245-
# Clear synonyms and forward to slaves
2248+
# Clear synonyms and forward to replicas
22462249
index.clear_synonyms(True)
22472250
```
22482251

0 commit comments

Comments
 (0)