Skip to content

TextService

Full-text search operations backed by tantivy (BM25 scoring, 30+ languages).

Proto source

query/text.proto

Transport

All methods are available via:

  • gRPC on port 7080 — native high-performance API
  • REST/JSON on port 7081 — HTTP/JSON transcoding via embedded structured-proxy

Methods

TextSearch

Search nodes matching a full-text query within a label. Searches all text-indexed properties for the label and returns BM25-scored results with optional HTML-highlighted snippets. If no text index is registered for the label, returns an empty result set (no error). Query syntax: boolean (AND, OR, NOT), phrase ("exact phrase"), prefix wildcard (term*), per-term boosting (term^N).

HTTP: POST /v1/query/text/search

Request: TextSearchRequest

FieldTypeDescription
labelstringLabel to search within (e.g., "Article", "Document"). Must have at least one text index registered; returns empty results otherwise.
querystringFull-text query string. Supports boolean operators (AND, OR, NOT), phrase search ("exact phrase"), prefix wildcards (term*), and per-term boosting (term^N). Examples: "rust AND graph" "machine learning" "data*" "name^3 OR description^1"
limituint32Maximum number of results to return. 0 = default (10). Capped at 1000.
fuzzyboolIf true, enable Levenshtein-1 fuzzy matching for individual query terms. Increases recall at the cost of precision. Not applied to quoted phrases or terms that already contain operators.
languagestringLanguage for query tokenization and stemming (e.g., "english", "russian", "chinese_jieba", "japanese_lindera", "none"). Empty string = use the index's default language (typically "english" unless overridden at index creation time).

Response: TextSearchResponse

FieldTypeDescription
resultsTextResult[]Results ordered by BM25 score descending (most relevant first).

Types

TextResult

A single text search result with BM25 score and optional highlighted snippet.

FieldTypeDescription
node_iduint64Node ID of the matching node.
scorefloatBM25 relevance score. Higher = more relevant to the query. Not normalized; values depend on corpus size and per-field weights.
snippetstringHTML-tagged snippet of matching text with <b> tags around matched terms. Derived from the indexed field text using tantivy's SnippetGenerator. Empty when language-specific search is used (highlight requires default language tokenization) or when the indexed field has no stored content. Strip <b> and </b> tags for plain-text display.

TextSearchRequest

Request to search indexed text properties across a node label.

FieldTypeDescription
labelstringLabel to search within (e.g., "Article", "Document"). Must have at least one text index registered; returns empty results otherwise.
querystringFull-text query string. Supports boolean operators (AND, OR, NOT), phrase search ("exact phrase"), prefix wildcards (term*), and per-term boosting (term^N). Examples: "rust AND graph" "machine learning" "data*" "name^3 OR description^1"
limituint32Maximum number of results to return. 0 = default (10). Capped at 1000.
fuzzyboolIf true, enable Levenshtein-1 fuzzy matching for individual query terms. Increases recall at the cost of precision. Not applied to quoted phrases or terms that already contain operators.
languagestringLanguage for query tokenization and stemming (e.g., "english", "russian", "chinese_jieba", "japanese_lindera", "none"). Empty string = use the index's default language (typically "english" unless overridden at index creation time).

TextSearchResponse

Response containing BM25-scored text search results.

FieldTypeDescription
resultsTextResult[]Results ordered by BM25 score descending (most relevant first).