pub struct TextSearchBuilder<'e> { /* private fields */ }Expand description
Tethered text-search builder returned from
NodeQueryBuilder::text_search.
Accumulates filter predicates alongside the text-search step and dispatches
.execute() through fathomdb_engine::ExecutionCoordinator::execute_compiled_search,
returning SearchRows populated with score, source, snippet, and
active-version written_at values.
Implementations§
Source§impl TextSearchBuilder<'_>
impl TextSearchBuilder<'_>
Sourcepub fn with_match_attribution(self) -> Self
pub fn with_match_attribution(self) -> Self
Request per-hit match attribution.
When set, the coordinator populates
SearchHit::attribution on
every hit with the set of property paths (or "text_content" for
chunk hits) that contributed to the match. Without this flag (the
default), attribution stays None and the Phase 4 position map is not
read at all — it is a pay-as-you-go feature.
Sourcepub fn filter_logical_id_eq(self, logical_id: impl Into<String>) -> Self
pub fn filter_logical_id_eq(self, logical_id: impl Into<String>) -> Self
Filter results to a single logical ID.
Sourcepub fn filter_kind_eq(self, kind: impl Into<String>) -> Self
pub fn filter_kind_eq(self, kind: impl Into<String>) -> Self
Filter results to nodes matching the given kind.
Sourcepub fn filter_source_ref_eq(self, source_ref: impl Into<String>) -> Self
pub fn filter_source_ref_eq(self, source_ref: impl Into<String>) -> Self
Filter results to nodes matching the given source_ref.
Sourcepub fn filter_content_ref_not_null(self) -> Self
pub fn filter_content_ref_not_null(self) -> Self
Filter results to nodes where content_ref is not NULL.
Sourcepub fn filter_content_ref_eq(self, content_ref: impl Into<String>) -> Self
pub fn filter_content_ref_eq(self, content_ref: impl Into<String>) -> Self
Filter results to nodes matching the given content_ref URI.
Sourcepub fn filter_json_text_eq(
self,
path: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn filter_json_text_eq( self, path: impl Into<String>, value: impl Into<String>, ) -> Self
Filter results where a JSON property at path equals the given text value.
Sourcepub fn filter_json_bool_eq(self, path: impl Into<String>, value: bool) -> Self
pub fn filter_json_bool_eq(self, path: impl Into<String>, value: bool) -> Self
Filter results where a JSON property at path equals the given boolean value.
Sourcepub fn filter_json_integer_gt(self, path: impl Into<String>, value: i64) -> Self
pub fn filter_json_integer_gt(self, path: impl Into<String>, value: i64) -> Self
Filter results where a JSON integer at path is greater than value.
Sourcepub fn filter_json_integer_gte(
self,
path: impl Into<String>,
value: i64,
) -> Self
pub fn filter_json_integer_gte( self, path: impl Into<String>, value: i64, ) -> Self
Filter results where a JSON integer at path is greater than or equal to value.
Sourcepub fn filter_json_integer_lt(self, path: impl Into<String>, value: i64) -> Self
pub fn filter_json_integer_lt(self, path: impl Into<String>, value: i64) -> Self
Filter results where a JSON integer at path is less than value.
Sourcepub fn filter_json_integer_lte(
self,
path: impl Into<String>,
value: i64,
) -> Self
pub fn filter_json_integer_lte( self, path: impl Into<String>, value: i64, ) -> Self
Filter results where a JSON integer at path is less than or equal to value.
Sourcepub fn filter_json_timestamp_gt(
self,
path: impl Into<String>,
value: i64,
) -> Self
pub fn filter_json_timestamp_gt( self, path: impl Into<String>, value: i64, ) -> Self
Filter results where a JSON timestamp at path is after value.
Sourcepub fn filter_json_timestamp_gte(
self,
path: impl Into<String>,
value: i64,
) -> Self
pub fn filter_json_timestamp_gte( self, path: impl Into<String>, value: i64, ) -> Self
Filter results where a JSON timestamp at path is at or after value.
Sourcepub fn filter_json_timestamp_lt(
self,
path: impl Into<String>,
value: i64,
) -> Self
pub fn filter_json_timestamp_lt( self, path: impl Into<String>, value: i64, ) -> Self
Filter results where a JSON timestamp at path is before value.
Sourcepub fn filter_json_timestamp_lte(
self,
path: impl Into<String>,
value: i64,
) -> Self
pub fn filter_json_timestamp_lte( self, path: impl Into<String>, value: i64, ) -> Self
Filter results where a JSON timestamp at path is at or before value.
Sourcepub fn filter_json_fused_text_eq(
self,
path: impl Into<String>,
value: impl Into<String>,
) -> Result<Self, BuilderValidationError>
pub fn filter_json_fused_text_eq( self, path: impl Into<String>, value: impl Into<String>, ) -> Result<Self, BuilderValidationError>
Filter results where a JSON text property at path equals
value, with fusion semantics. See
NodeQueryBuilder::filter_json_fused_text_eq for the contract.
§Errors
Returns BuilderValidationError if the root kind has no
registered property-FTS schema or the schema does not cover
path.
Sourcepub fn filter_json_fused_text_in(
self,
path: impl Into<String>,
values: Vec<String>,
) -> Result<Self, BuilderValidationError>
pub fn filter_json_fused_text_in( self, path: impl Into<String>, values: Vec<String>, ) -> Result<Self, BuilderValidationError>
Filter results where a JSON text property at path is one of
values, with fusion semantics.
§Errors
Sourcepub fn filter_json_text_in(
self,
path: impl Into<String>,
values: Vec<String>,
) -> Self
pub fn filter_json_text_in( self, path: impl Into<String>, values: Vec<String>, ) -> Self
Filter results where a JSON text property at path is one of
values. Non-fused; no FTS schema required.
Sourcepub fn filter_json_fused_timestamp_gt(
self,
path: impl Into<String>,
value: i64,
) -> Result<Self, BuilderValidationError>
pub fn filter_json_fused_timestamp_gt( self, path: impl Into<String>, value: i64, ) -> Result<Self, BuilderValidationError>
Filter results where a JSON timestamp at path is strictly
greater than value, with fusion semantics.
§Errors
Sourcepub fn filter_json_fused_timestamp_gte(
self,
path: impl Into<String>,
value: i64,
) -> Result<Self, BuilderValidationError>
pub fn filter_json_fused_timestamp_gte( self, path: impl Into<String>, value: i64, ) -> Result<Self, BuilderValidationError>
Filter results where a JSON timestamp at path is at or after
value, with fusion semantics.
§Errors
Sourcepub fn filter_json_fused_timestamp_lt(
self,
path: impl Into<String>,
value: i64,
) -> Result<Self, BuilderValidationError>
pub fn filter_json_fused_timestamp_lt( self, path: impl Into<String>, value: i64, ) -> Result<Self, BuilderValidationError>
Filter results where a JSON timestamp at path is strictly
before value, with fusion semantics.
§Errors
Sourcepub fn filter_json_fused_timestamp_lte(
self,
path: impl Into<String>,
value: i64,
) -> Result<Self, BuilderValidationError>
pub fn filter_json_fused_timestamp_lte( self, path: impl Into<String>, value: i64, ) -> Result<Self, BuilderValidationError>
Filter results where a JSON timestamp at path is at or before
value, with fusion semantics.
§Errors
Sourcepub fn filter_json_fused_bool_eq(
self,
path: impl Into<String>,
value: bool,
) -> Result<Self, BuilderValidationError>
pub fn filter_json_fused_bool_eq( self, path: impl Into<String>, value: bool, ) -> Result<Self, BuilderValidationError>
Filter results where a JSON boolean property at path equals
value, with fusion semantics. See
Self::filter_json_fused_text_eq for the contract.
§Errors
Sourcepub fn limit(self, limit: usize) -> Self
pub fn limit(self, limit: usize) -> Self
Set the final row limit on the underlying AST.
Phase 1 note: CompiledSearch derives
its effective limit from the text_search step, not from this field.
limit is still delegated to the inner builder so callers that later
fall back to [TextSearchBuilder::compile_query] keep the same shape.
Sourcepub fn traverse(
self,
direction: TraverseDirection,
label: impl Into<String>,
max_depth: usize,
) -> Self
pub fn traverse( self, direction: TraverseDirection, label: impl Into<String>, max_depth: usize, ) -> Self
Add a graph traversal step. Applied after the text-search step when
the inner AST is compiled via [TextSearchBuilder::compile_query].
The Phase 1 TextSearchBuilder::execute path ignores traversals.
Sourcepub fn expand(
self,
slot: impl Into<String>,
direction: TraverseDirection,
label: impl Into<String>,
max_depth: usize,
filter: Option<Predicate>,
edge_filter: Option<Predicate>,
) -> Self
pub fn expand( self, slot: impl Into<String>, direction: TraverseDirection, label: impl Into<String>, max_depth: usize, filter: Option<Predicate>, edge_filter: Option<Predicate>, ) -> Self
Add an expansion slot. Applied when compiling via
[TextSearchBuilder::compile_grouped_query]; ignored by
TextSearchBuilder::execute in Phase 1.
Pass filter: None to preserve the existing behavior. filter: Some(_) is
accepted by the AST but the compilation is not yet implemented (Pack 3).
Pass edge_filter: None to preserve pre-Pack-D behavior.
Sourcepub fn as_builder(&self) -> &QueryBuilder
pub fn as_builder(&self) -> &QueryBuilder
Borrow the underlying QueryBuilder.
Sourcepub fn compile(&self) -> Result<CompiledQuery, CompileError>
pub fn compile(&self) -> Result<CompiledQuery, CompileError>
Compile the underlying AST as a flat CompiledQuery. Provided for
call sites that mix search with traversal steps and still need to run
the flat node-row pipeline.
§Errors
Returns CompileError if compilation fails.
Sourcepub fn compile_grouped(&self) -> Result<CompiledGroupedQuery, CompileError>
pub fn compile_grouped(&self) -> Result<CompiledGroupedQuery, CompileError>
Compile the underlying AST as a CompiledGroupedQuery.
§Errors
Returns CompileError if compilation fails.
Sourcepub fn execute(&self) -> Result<SearchRows, EngineError>
pub fn execute(&self) -> Result<SearchRows, EngineError>
Execute the text search and return matching hits.
§Errors
Returns EngineError if compilation or execution fails.