TextService
Full-text search operations backed by tantivy (BM25 scoring, 30+ languages).
Proto source
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
| Field | Type | Description |
|---|---|---|
label | string | Label to search within (e.g., "Article", "Document"). Must have at least one text index registered; returns empty results otherwise. |
query | string | Full-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" |
limit | uint32 | Maximum number of results to return. 0 = default (10). Capped at 1000. |
fuzzy | bool | If 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. |
language | string | Language 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
| Field | Type | Description |
|---|---|---|
results | TextResult[] | Results ordered by BM25 score descending (most relevant first). |
Types
TextResult
A single text search result with BM25 score and optional highlighted snippet.
| Field | Type | Description |
|---|---|---|
node_id | uint64 | Node ID of the matching node. |
score | float | BM25 relevance score. Higher = more relevant to the query. Not normalized; values depend on corpus size and per-field weights. |
snippet | string | HTML-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.
| Field | Type | Description |
|---|---|---|
label | string | Label to search within (e.g., "Article", "Document"). Must have at least one text index registered; returns empty results otherwise. |
query | string | Full-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" |
limit | uint32 | Maximum number of results to return. 0 = default (10). Capped at 1000. |
fuzzy | bool | If 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. |
language | string | Language 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.
| Field | Type | Description |
|---|---|---|
results | TextResult[] | Results ordered by BM25 score descending (most relevant first). |
