1
0
Fork 0
arangodb/Documentation/Books/Users/IndexHandling/Fulltext.mdpp

32 lines
1.4 KiB
Plaintext

!CHAPTER Fulltext indexes
!SUBSECTION Introduction to Fulltext Indexes
This is an introduction to ArangoDB's fulltext indexes.
It is possible to define a fulltext index on one textual attribute of a
collection of documents. The fulltext index can then be used to efficiently find
exact words or prefixes of words contained in these documents.
!SECTION Accessing Fulltext Indexes from the Shell
`ensureFulltextIndex(field, minWordLength)`
Creates a fulltext index on all documents on attribute field.
All documents which do not have the specified *field* attribute or that have a non-textual value inside their *field* attribute will be ignored for indexing.
Only a single attribute can be indexed. Specifying multiple attributes is unsupported.
The minimum length of words that are indexed can be specified with the *minWordLength* parameter. Words shorter than minWordLength characters will not be indexed. minWordLength has a default value of 2, but this value might be changed in future versions of ArangoDB. It is thus recommended to explicitly specify this value
In case the index is successfully created, the index identifier is returned.
```
arangosh> db.emails.ensureFulltextIndex("body");
{ "id" : "emails/42725508", "unique" : false, "type" : "fulltext", "fields" : ["body"], "isNewlyCreated" : true }
```
<!--
@anchor IndexFulltextShellEnsureFulltextIndex
@copydetails JSF_ArangoCollection_prototype_ensureFulltextIndex
-->