Skip to main content

Fulltext indices

The intent fulltext makes the words of a string searchable.

DatabaseIndex
Neo4jfull-text index (Neo4j 5.0 or newer, older versions fail the migration step), for properties stored in Neo4j
MongoDBthe text index of the collection, ens_<type>_fulltext_<hash>, for properties stored in MongoDB and nested properties
Elasticsearchtext field, with a keyword sub-field if exact is requested as well
{
"type": "string",
"index": "fulltext"
}

A string which is looked up by exact value and searched as text has "index": ["exact", "fulltext"].

The full-text index of Neo4j splits strings into words with an analyzer (Lucene’s standard-no-stop-words by default) and is queried with the procedures db.index.fulltext.queryNodes() and db.index.fulltext.queryRelationships(), not with MATCH ... WHERE. Neo4j also has a text index, which serves =, STARTS WITH, ENDS WITH and CONTAINS on the whole string, but finds no words; it is not used for fulltext and is available as a raw Neo4j index ({"type": "text"}).

Elasticsearch needs no intent: it is the search engine of the API, so it maps every string like its dynamic mapping does, as a text field with a keyword sub-field, and both full text and exact searches work without a definition. fulltext and exact for elasticsearch only narrow this mapping, see nested properties and the databases. The keyword field ignores values of more than 256 characters, so long strings can only be found by their words, see the limits of strings.

MongoDB allows one text index per collection: it covers every property of the type which asks for fulltext in MongoDB, see nested properties.