We provide customized fields inside of
_buildfire object to be used as indexed fields and to support high-performance search and sort query for plugin developers.
Basically, you will use all methods in
appData service, but you will need to pay attention to pass the values in a specific structure so we can make sure that these values will be indexed and to provide high-performance search query.
Developers can store the needed values in the following fields inside of
_buildfire.index object :
These are keywords and not meant to be replaced. Meaning
string1 isn't meant to be replaced with
This is the most important part, because the rest will follow like any other type of data. So when you insert the indexed values you need to put it like the JSON structure below:
Please note that you can use any combination of the above fields, we can make an index for you depends on the provided data in the
_buildfire.index object ( you can provide
date1 for example) it depends on your requirement.
Let's say that You have a use case to filter the data depending on a
username (string value) and
createdOn (date value). First you need to store a data in a way to make sure that the desired fields for the filters are in the indexed fields like the following:
To use an array in the index object, you should follow the below structure, each object in the array should have an attribute string1; string1 is the key for the index
Let's say that You have a use case to filter the data depending on user badges (array of objects), you need to store data in a way where you have to make sure that the desired fields for the filters are provided in the indexed fields like the following:
Developers can store the string content in the text field inside of
_buildfire.index object to support text search queries on text content, this will help to speed up the retrieving process for the data.
The text index is used to speed up search through text but it's not useful to apply fuzziness or using regex matching which means if you have "BuildFire" as a phrase stored in your text data and you are trying to search for "Bu" this will not return that document because search using text index will do the exact match on phrases.
This is the most important part, because the rest will follow like any other type of data. So when you insert the data, you need to put the text like the below JSON structure to perform text search on the saved data:
When you need to perform text search, the filter object must be like the following:
Please note that in case you use the text index and use the primitive index adjacently in your search query, the query will make use of the text index and will not use the primitive index which will affect the search query performance.
The search query will use the text index only and it will ignore the primitive index.
Let's say that You have a use case to filter the data depends on description (text), First you need to store a data in a way which you have to make sure that the desired fields for the filters are provided in the text field like the following:
- You cannot combine the
$textexpression, which requires a special text index, with a query operator that requires a different type of special index. For example you cannot combine
$textexpression with the
- To use a
$textquery in an
$orexpression, all clauses in the
$orarray must be indexed.
$text operator accepts a text query document with the following fields:
A string of terms that we use to allow the developers to use the text index. The text index performs a logical OR search of the terms unless specified as a phrase.
$search field, specify a string of words that the text operator parses and uses to query the text index.
The text operator treats most punctuation in the string as delimiters, except a hyphen-minus (-) that negates term or an escaped double quotes
\" that specifies a phrase.
To match on a phrase, as opposed to individual terms, enclose the phrase in escaped double quotes
\", as in:
$searchstring includes a phrase and individual terms, text search will only match the documents that include the phrase.
For example, passed a
"\"ssl certificate\" authority key"The
$textoperator searches for the phrase
Prefixing a word with a hyphen-minus
-negates a word:
The negated word excludes documents that contain the negated word from the result set. When passed a search string that only contains negated words, text search will not match any documents. A hyphenated word, such as pre-market, is not a negation. If used in a hyphenated word, $text operator treats the hyphen-minus
-as a delimiter. To negate the word market in this instance, include a space between pre and
$text operator adds all negations to the query with the logical
The language that determines the list of stop words for the search and the rules for the tokenizer. If not specified, the search uses the default language of the index. If you specify a language value of "none", then the text search uses simple tokenization with no list of stop words.
Stop word example: ("to", "is", "are")
|Language Name||ISO 639-1 (Two letter codes)|
A boolean flag to enable or disable case sensitive search. Defaults to
false; i.e. the search defers to the case insensitivity of the text index.