Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeTextQuery

OfficeIMO.TextAnalysis

Namespace
OfficeIMO.TextAnalysis
Assembly
OfficeIMO.Core
Source revision
ac7e6e1bad8a with working tree changes
Modifiers
sealed

A query over an OfficeTextIndex: terms, phrases, prefixes and AND/OR combinations of them. Query text is analysed with the index analyser when the query runs.

Inheritance

  • object
  • OfficeTextQuery

Remarks

OfficeTextQuery.Parse accepts words, "quoted phrases", prefix*, the upper-case operators AND and OR, and parentheses. AND binds tighter than OR. A word that the analyser splits into several tokens, such as e-mail or a run of Han ideographs, is matched as a phrase.

Usage

Explore 11 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 3

Methods

public static OfficeTextQuery And(params OfficeTextQuery[] clauses) #

Matches documents matching every clause.

Parameters

clauses OfficeIMO.TextAnalysis.OfficeTextQuery[] required
public static OfficeTextQuery Or(params OfficeTextQuery[] clauses) #

Matches documents matching at least one clause.

Parameters

clauses OfficeIMO.TextAnalysis.OfficeTextQuery[] required
public static OfficeTextQuery? Parse(string text, OfficeTextQueryOperator defaultOperator = And) #

Parses query syntax. Returns null when the text contains no clauses, for example only operators or quotes.

Parameters

text string required
defaultOperator OfficeIMO.TextAnalysis.OfficeTextQueryOperator = And optional
public static OfficeTextQuery Phrase(string text) #

Matches words that appear consecutively in one field.

Parameters

text string required
public static OfficeTextQuery Prefix(string text) #

Matches any term starting with text after normalization and folding.

Parameters

text string required
public static OfficeTextQuery Term(string text) #

Matches one word.

Parameters

text string required
public override string ToString() #

Returns a string that represents the current object.

Returns

string A string that represents the current object.

Properties

public OfficeTextQueryKind Kind { get; } #

Node kind.

public string? Text { get; } #

Source text for term, phrase and prefix nodes; null for AND and OR.

public IReadOnlyList<OfficeTextQuery> Children { get; } #

Child clauses of AND and OR nodes; empty for leaves.

public int ClauseCount { get; } #

Number of term, phrase and prefix clauses in the query.