Class CompoundSearchDefinitionBuilder<TDocument>
A builder for compound search definitions.
public sealed class CompoundSearchDefinitionBuilder<TDocument>
Type Parameters
TDocument
The type of the document.
- Inheritance
-
CompoundSearchDefinitionBuilder<TDocument>
- Inherited Members
Constructors
CompoundSearchDefinitionBuilder(SearchScoreDefinition<TDocument>)
Initializes a new instance of the CompoundSearchDefinitionBuilder<TDocument> class.
public CompoundSearchDefinitionBuilder(SearchScoreDefinition<TDocument> score = null)
Parameters
score
SearchScoreDefinition<TDocument>
Methods
Filter(params SearchDefinition<TDocument>[])
Adds clauses which must all match for a document to be included in the results.
public CompoundSearchDefinitionBuilder<TDocument> Filter(params SearchDefinition<TDocument>[] clauses)
Parameters
clauses
SearchDefinition<TDocument>[]The clauses.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
The compound search definition builder.
Filter(IEnumerable<SearchDefinition<TDocument>>)
Adds clauses which must all match for a document to be included in the results.
public CompoundSearchDefinitionBuilder<TDocument> Filter(IEnumerable<SearchDefinition<TDocument>> clauses)
Parameters
clauses
IEnumerable<SearchDefinition<TDocument>>The clauses.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
The compound search definition builder.
MinimumShouldMatch(int)
Sets a value specifying the minimum number of should clauses the must match to include a document in the results.
public CompoundSearchDefinitionBuilder<TDocument> MinimumShouldMatch(int minimumShouldMatch)
Parameters
minimumShouldMatch
intThe value to set.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
The compound search definition builder.
Must(params SearchDefinition<TDocument>[])
Adds clauses which must match to produce results.
public CompoundSearchDefinitionBuilder<TDocument> Must(params SearchDefinition<TDocument>[] clauses)
Parameters
clauses
SearchDefinition<TDocument>[]The clauses.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
The compound search definition builder.
Must(IEnumerable<SearchDefinition<TDocument>>)
Adds clauses which must match to produce results.
public CompoundSearchDefinitionBuilder<TDocument> Must(IEnumerable<SearchDefinition<TDocument>> clauses)
Parameters
clauses
IEnumerable<SearchDefinition<TDocument>>The clauses.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
The compound search definition builder.
MustNot(params SearchDefinition<TDocument>[])
Adds clauses which must not match for a document to be included in the results.
public CompoundSearchDefinitionBuilder<TDocument> MustNot(params SearchDefinition<TDocument>[] clauses)
Parameters
clauses
SearchDefinition<TDocument>[]The clauses.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
The compound search definition builder.
MustNot(IEnumerable<SearchDefinition<TDocument>>)
Adds clauses which must not match for a document to be included in the results.
public CompoundSearchDefinitionBuilder<TDocument> MustNot(IEnumerable<SearchDefinition<TDocument>> clauses)
Parameters
clauses
IEnumerable<SearchDefinition<TDocument>>The clauses.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
The compound search definition builder.
Should(params SearchDefinition<TDocument>[])
Adds clauses which cause documents in the result set to be scored higher if they match.
public CompoundSearchDefinitionBuilder<TDocument> Should(params SearchDefinition<TDocument>[] clauses)
Parameters
clauses
SearchDefinition<TDocument>[]The clauses.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
The compound search definition builder.
Should(IEnumerable<SearchDefinition<TDocument>>)
Adds clauses which cause documents in the result set to be scored higher if they match.
public CompoundSearchDefinitionBuilder<TDocument> Should(IEnumerable<SearchDefinition<TDocument>> clauses)
Parameters
clauses
IEnumerable<SearchDefinition<TDocument>>The clauses.
Returns
- CompoundSearchDefinitionBuilder<TDocument>
The compound search definition builder.
ToSearchDefinition()
Constructs a search definition from the builder.
public SearchDefinition<TDocument> ToSearchDefinition()
Returns
- SearchDefinition<TDocument>
A compound search definition.
Operators
implicit operator SearchDefinition<TDocument>(CompoundSearchDefinitionBuilder<TDocument>)
Performs an implicit conversion from a CompoundSearchDefinitionBuilder<TDocument> to a SearchDefinition<TDocument>.
public static implicit operator SearchDefinition<TDocument>(CompoundSearchDefinitionBuilder<TDocument> builder)
Parameters
builder
CompoundSearchDefinitionBuilder<TDocument>The compound search definition builder.
Returns
- SearchDefinition<TDocument>
The result of the conversion.