# OfficeDocumentSearchOptions

Controls normalized block search in a document read result.

Class 

`OfficeIMO.Reader`

**Namespace**

`OfficeIMO.Reader`

**Assembly**

`OfficeIMO.Reader.Core`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OfficeDocumentSearch.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Reader.Core/OfficeDocumentSearch.cs#L12)

**Modifiers**

sealed

Controls normalized block search in a document read result.

## Inheritance

- object
- OfficeDocumentSearchOptions

## Usage

Explore 2 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 2

- Extension method [OfficeDocumentReadResult.Search](/api/reader/officeimo-reader-officedocumentreadresult/#extension-search-officeimo-reader-officedocumentreadresult-string-officeimo-reader-officedocumentsearchoptions-threading-cancellationtoken) parameter `options`
- Method [OfficeDocumentReadResultExtensions.Search](/api/reader/officeimo-reader-officedocumentreadresultextensions/#method-search-officeimo-reader-officedocumentreadresult-string-officeimo-reader-officedocumentsearchoptions-threading-cancellationtoken) parameter `options`

Filter members 

Show inherited

## Constructors

`public OfficeDocumentSearchOptions()` [#](#constructor-ctor)

[OfficeDocumentSearch.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Reader.Core/OfficeDocumentSearch.cs#L12)

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public bool MatchCase { get; set; }` [#](#property-matchcase)

[OfficeDocumentSearch.cs:6](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Reader.Core/OfficeDocumentSearch.cs#L6)

When true, uses case-sensitive ordinal matching.

`public bool UseRegularExpressions { get; set; }` [#](#property-useregularexpressions)

[OfficeDocumentSearch.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Reader.Core/OfficeDocumentSearch.cs#L9)

When true, interprets the query as a .NET regular expression. The default preserves literal search.

`public TimeSpan RegularExpressionTimeout { get; set; }` [#](#property-regularexpressiontimeout)

[OfficeDocumentSearch.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Reader.Core/OfficeDocumentSearch.cs#L12)

Maximum time allowed for one regular-expression match attempt. Must be positive and finite; defaults to two seconds.

`public bool WholeWord { get; set; }` [#](#property-wholeword)

[OfficeDocumentSearch.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Reader.Core/OfficeDocumentSearch.cs#L15)

When true, accepts matches surrounded by non-word characters only.

`public int MaximumResults { get; set; }` [#](#property-maximumresults)

[OfficeDocumentSearch.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Reader.Core/OfficeDocumentSearch.cs#L18)

Maximum number of occurrences returned. Default: 1,000.

`public OfficeDocumentSearchMode Mode { get; set; }` [#](#property-mode)

[OfficeDocumentSearch.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Reader.Core/OfficeDocumentSearch.cs#L26)

Literal occurrence search (the default) or BM25-ranked word search. Ranked mode returns one hit per matching block, best first. When a complete ranked search finds no hits, the search falls back to literal matching. [OfficeDocumentSearchOptions.UseRegularExpressions](/api/reader/officeimo-reader-officedocumentsearchoptions/) takes precedence; [OfficeDocumentSearchOptions.WholeWord](/api/reader/officeimo-reader-officedocumentsearchoptions/) does not apply because ranked search always matches whole words.

`public OfficeDocumentRankingOptions Ranking { get; set; }` [#](#property-ranking)

[OfficeDocumentSearch.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Reader.Core/OfficeDocumentSearch.cs#L29)

Ranking, query and resource settings used when [OfficeDocumentSearchOptions.Mode](/api/reader/officeimo-reader-officedocumentsearchoptions/) is [OfficeDocumentSearchMode.Ranked](/api/reader/officeimo-reader-officedocumentsearchmode/).

<!-- PowerForge markdown artifact sha256:8DB099C753886A45638277A29B275F7CA24DC7A6571531EE48F4EC7601AC2617 -->
