Reference Entry
Testing Patterns from the Repository
Operations · advanced · order 10
The test suite documents expected ranking, query, vector, and geo behavior.
Relevant APIs
Testing Patterns from the Repository
The repository tests are worth reading because they define the intended semantics of the library.
Examples covered in tests
- phrase search
- BM25 score stability
- bool query logic
- range filters
- trie prefix behavior
- vector retrieval
- geo queries
- significant terms
expect(index.searchRequest({
query: new MatchPhrase("description", "to be or not to be")
})).toHaveLength(1);
expect(index.search(new MatchQuery("text", "foo"))[0]?.[0]).toBe("1");