Creating a full-text index for a node label
Using procedure syntax
To construct a full-text index on thetitle property of all nodes with label Movie, use the syntax:
- Language - Define which language to use for stemming text, which is adding the base form of a word to the index. This allows the query for “going” to also return results for “go” and “gone”, for example.
- Stopwords - These are words that are usually so common that they do not add much information to search, but take up a lot of space and CPU time in the index.
title property using German language and using custom stopwords of all nodes with label Movie, use the syntax:
- Weight - The importance of the text in the field
- Nostem - Skip stemming when indexing text
- Phonetic - Enable phonetic search on the text
title property with phonetic search of all nodes with label Movie, use the syntax:
Using DDL syntax
Full-text indexes for node labels can also be created using DDL syntax:OPTIONS block can be provided to specify additional configuration such as language and stopwords:
Query Syntax and Features
FalkorDB uses RediSearch query syntax which provides powerful search capabilities including fuzzy matching, prefix matching, and tokenization.Tokenization
When text is indexed, it is automatically tokenized (split into words). By default, text is split on whitespace and punctuation. This allows you to search for individual words within larger text fields. For example, if you index atitle property containing “The Lord of the Rings”, you can search for any of the individual words like “Lord” or “Rings”.
Prefix Matching
Prefix matching allows you to search for words that start with a specific prefix using the* wildcard. This is useful for autocomplete functionality or when you want to match word variations.
Jun*). The wildcard must appear at the end of the search term.
Fuzzy Matching
Fuzzy matching allows you to find words that are similar to your search term, accounting for typos and spelling variations. Use the% symbol followed by the Levenshtein distance (number of character changes allowed).
%term%distance where:
termis the word to matchdistanceis the maximum Levenshtein distance (1-3, default is 1 if not specified)
Combining Query Features
You can combine multiple search terms using boolean operators:AND(or space): All terms must matchOR(|): At least one term must matchNOT(-): Term must not be present
Utilizing a full-text index for a node label
An index can be invoked to match any whole words contained within:Deleting a full-text index for a node label
Using procedure syntax
For a node label, the procedure syntax drops all full-text indexed properties for the given label:Using DDL syntax
Full-text indexes for node labels can also be dropped using DDL syntax. Unlike the procedure syntax above, the DDL form drops only the specific property index:Creating Full-Text indexing for Relation Labels
To create a full-text index on the name property of all relations with the label Manager and enable phonetic search, use the following syntax:Querying with a Full-Text Index
To search for specific words within the indexed relations, use:Deleting a Full-Text Index
To delete the full-text index for a specific relation label, use:Index Management
Listing Full-text Indexes
To view all indexes (including full-text) in your graph, use:FULLTEXT.
Performance Tradeoffs and Best Practices
When to Use Full-text Indexes
Full-text indexes are ideal for:- Text-heavy search: Searching within large text fields like descriptions, articles, or comments
- Partial word matching: When users might not know the exact text
- Fuzzy search: Handling typos and spelling variations
- Multi-word queries: Searching for multiple terms with boolean logic
When NOT to Use Full-text Indexes
Full-text indexes are not optimal for:- Exact numeric filtering: Use range indexes instead for numeric comparisons
- Exact-match queries: Range indexes are more efficient for exact property matches
- Small or structured data: For short, well-defined strings, range indexes may be sufficient
Performance Considerations
Benefits:- Enables sophisticated text search capabilities (fuzzy, prefix, phonetic)
- Supports stemming and language-specific optimizations
- Returns relevance scores (TF-IDF) for ranking results
- Write overhead: Text must be tokenized and indexed on write
- Storage: Requires more space than range indexes due to tokenization and inverted indices
- Configuration complexity: Language, stopwords, and stemming settings affect results
- Query performance: Fuzzy matching is more expensive than exact matching
- Choose the correct language setting for proper stemming
- Configure appropriate stopwords for your use case
- Use prefix matching (
*) for autocomplete rather than full fuzzy search when possible - Test query performance with realistic data volumes
- Consider the tradeoff between index configurability and query performance
Configuration Best Practices
Language Selection:- Wrong language settings can produce poor stemming results
- Example: Searching “running” with English stemming finds “run”, but German stemming won’t
- Default stopwords are optimized for general text
- Customize stopwords for domain-specific applications (e.g., legal, medical, technical documents)
- Too many stopwords can hurt precision; too few increase index size
- Useful for name searches and when spelling variations are common
- Increases index size and query time
- Double Metaphone (
dm:en) is recommended for English
Verifying Full-text Index Usage
UseGRAPH.EXPLAIN to verify that full-text queries use the index:
Frequently Asked Questions
How do I create a full-text index?
How do I create a full-text index?
Use the procedure
CALL db.idx.fulltext.createNodeIndex('Label', 'property1', 'property2'). You can index one or more properties on a given label.How do I query a full-text index?
How do I query a full-text index?
Use
CALL db.idx.fulltext.queryNodes('Label', 'search term') YIELD node, score. The score reflects TF-IDF relevance ranking.Does full-text search support stemming?
Does full-text search support stemming?
Yes. Full-text indexes leverage RediSearch which supports stemming, stopwords, and phonetic matching for more flexible text search.
Can I create full-text indexes on relationships?
Can I create full-text indexes on relationships?
Yes. Use
db.idx.fulltext.queryRelationships('RelType', 'search term') to search relationships. Create the index on a relationship type similarly to node indexes.How do I delete a full-text index?
How do I delete a full-text index?
Use
CALL db.idx.fulltext.drop('Label') to remove the full-text index associated with a given label.