Indexes
Indexes store Documents and can perform search queries.
Firesearch supports both full-text indexes, and autocomplete indexes—while their underlying behaviour is different, the APIs are very similar.
Creating indexes
The easiest way to create an index is to use the Create new index web form. create new index web form in the Firesearch console. You may also do so programmatically using the CreateIndex
method on the appropriate service in the Firesearch API.
An index is created using a payload like this:
- See also the API reference for CreateIndex and note that the options for an Autocomplete index are different
The Index path
The Index path uniquely identifies the indexes. You use it when putting documents and making searches.
The Index path also refers to the Firestore location that holds the data for the index.
- Index paths must point to a Firestore collection (not a document), which means it must have an odd number of path segments.
Index options
When you create an index, you can tune its behaviour. This section gives you an overview of those options.
Language tells Firesearch which language to use when processing the text.
The following languages are supported:
english
(default)dutch
french
german
russian
spanish
swedish
Keep stop words tells Firesearch to keep words like "and" and "to" in the index, depending on the language
.
good bad ugly
the good the bad and the ugly
Keeping stop words will result in a larger index
Case sensitive tells Firesearch to preserve the case of the search text. By defaut, Firesearch transforms text to lowercase. This option does not affect the index size.
code should not be clever
Code should NOT be clever
No stemming allows you to tell Firesearch not to stem words down.
interest times
interesting interest in interesting times
Not stemming words will result in a larger index
What next?
- Learn about Documents in Firesearch