Class QueryRewriteResult
The result of rewriting a query into retrieval-ready form, including optional retrieval-oriented keywords and a search gate decision.
public class QueryRewriteResult
- Inheritance
-
QueryRewriteResult
- Inherited Members
Constructors
QueryRewriteResult(string, bool, IReadOnlyList<string>?)
public QueryRewriteResult(string query, bool needsSearch, IReadOnlyList<string>? keywords = null)
Parameters
querystringneedsSearchboolkeywordsIReadOnlyList<string>
Properties
Keywords
Optional retrieval-oriented search terms extracted from the query for text/keyword search. When set, the hybrid search text leg uses these shaped keywords instead of the raw query, helping lexical retrieval handle language-particle and formatting mismatches. Null when the rewriter does not provide keyword shaping.
public IReadOnlyList<string>? Keywords { get; }
Property Value
NeedsSearch
Whether the query requires document search. When false, the RAG pipeline should be skipped entirely.
public bool NeedsSearch { get; }
Property Value
Query
The semantic query to use for retrieval. When NeedsSearch is false, this is the original query unchanged.
public string Query { get; }
Property Value
Methods
Pass(string)
Creates a result indicating the query should bypass document search.
public static QueryRewriteResult Pass(string originalQuery)
Parameters
originalQuerystring
Returns
Search(string)
Creates a result with a (possibly rewritten) semantic query that needs document search.
public static QueryRewriteResult Search(string query)
Parameters
querystring
Returns
Search(string, IReadOnlyList<string>?)
Creates a result with a semantic query and retrieval-oriented keywords for text search.
public static QueryRewriteResult Search(string query, IReadOnlyList<string>? keywords)
Parameters
querystringkeywordsIReadOnlyList<string>