Table of Contents

Class LuceneQueryOptions

Namespace
Examine.Lucene.Search
Assembly
Examine.Lucene.dll

Lucene.NET specific query options

public class LuceneQueryOptions : QueryOptions
Inheritance
LuceneQueryOptions
Inherited Members

Constructors

LuceneQueryOptions(int, int, SearchAfterOptions?, bool, bool, int, bool, LuceneFacetSamplingQueryOptions?)

Constructor

public LuceneQueryOptions(int skip, int take = 100, SearchAfterOptions? searchAfter = null, bool trackDocumentScores = false, bool trackDocumentMaxScore = false, int skipTakeMaxResults = 10000, bool autoCalculateSkipTakeMaxResults = false, LuceneFacetSamplingQueryOptions? facetSampling = null)

Parameters

skip int

Number of result documents to skip.

take int

Optional number of result documents to take.

searchAfter SearchAfterOptions

Optionally skip to results after the results from the previous search execution. Used for efficent deep paging.

trackDocumentScores bool

Whether to Track Document Scores. For best performance, if not needed, leave false.

trackDocumentMaxScore bool

Whether to track the maximum document score. For best performance, if not needed, leave false.

skipTakeMaxResults int

When using Skip/Take (not SearchAfter) this will be the maximum data set size that can be paged.

autoCalculateSkipTakeMaxResults bool

If enabled, this will pre-calculate the document count in the index to use for SkipTakeMaxResults.

facetSampling LuceneFacetSamplingQueryOptions

Whether to apply Facet sampling to improve performance. If not required, leave null.

LuceneQueryOptions(int, int?, SearchAfterOptions?, bool, bool, int, bool)

Constructor

[Obsolete("To remove in Examine 5.0")]
public LuceneQueryOptions(int skip, int? take = null, SearchAfterOptions? searchAfter = null, bool trackDocumentScores = false, bool trackDocumentMaxScore = false, int skipTakeMaxResults = 10000, bool autoCalculateSkipTakeMaxResults = false)

Parameters

skip int

Number of result documents to skip.

take int?

Optional number of result documents to take.

searchAfter SearchAfterOptions

Optionally skip to results after the results from the previous search execution. Used for efficent deep paging.

trackDocumentScores bool

Whether to Track Document Scores. For best performance, if not needed, leave false.

trackDocumentMaxScore bool

Whether to track the maximum document score. For best performance, if not needed, leave false.

skipTakeMaxResults int

When using Skip/Take (not SearchAfter) this will be the maximum data set size that can be paged.

autoCalculateSkipTakeMaxResults bool

If enabled, this will pre-calculate the document count in the index to use for SkipTakeMaxResults.

Properties

AutoCalculateSkipTakeMaxResults

If enabled, this will pre-calculate the document count in the index to use for SkipTakeMaxResults.

public bool AutoCalculateSkipTakeMaxResults { get; }

Property Value

bool

Remarks

This will incur a performance hit on each search execution since there will be a query to get the total document count.

FacetRandomSampling

Options for Lucene Facet Sampling. If not set, no Facet Sampling is applied.

public LuceneFacetSamplingQueryOptions? FacetRandomSampling { get; }

Property Value

LuceneFacetSamplingQueryOptions

Remarks

Performance optimization for large result sets.

SearchAfter

Options for Searching After. Used for efficient deep paging.

public SearchAfterOptions? SearchAfter { get; }

Property Value

SearchAfterOptions

SkipTakeMaxResults

When using Skip/Take (not SearchAfter) this will be the maximum data set size that can be paged.

public int SkipTakeMaxResults { get; }

Property Value

int

Remarks

For performance reasons, this should be low. The default is 10k and if larger datasets are required to be paged, this value can be increased but it is recommended to use the SearchAfter feature instead.

TrackDocumentMaxScore

Whether to track the maximum document score. For best performance, if not needed, leave false.

public bool TrackDocumentMaxScore { get; }

Property Value

bool

TrackDocumentScores

Whether to Track Document Scores. For best performance, if not needed, leave false.

public bool TrackDocumentScores { get; }

Property Value

bool