C# Class Rubber.DSL.Query.QueryStringQueryBuilder

A query that parses a query string and runs it. There are two modes that this operates. The first, when no field is added (using {@link #field(string)}, will run the query once and non prefixed fields will use the {@link #defaultField(string)} set. The second, when one or more fields are added (using {@link #field(string)}), will run the parsed query against the provided fields, and combine them either using DisMax or a plain boolean query (see {@link #useDisMax(boolean)}).
Inheritance: IQueryBuilder
Afficher le fichier Open project: stephenpope/Rubber

Méthodes publiques

Méthode Description
AllowLeadingWildcard ( bool allowLeadingWildcard ) : QueryStringQueryBuilder

Should leading wildcards be allowed or not. Defaults to true.

AnalyzeWildcard ( bool analyzeWildcard ) : QueryStringQueryBuilder

Set to true to enable analysis on wildcard and prefix queries.

Analyzer ( string analyzer ) : QueryStringQueryBuilder

The optional analyzer used to analyze the query string. Note, if a field has search analyzer defined for it, then it will be used automatically. Defaults to the smart search analyzer.

AutoGeneratePhraseQueries ( bool autoGeneratePhraseQueries ) : QueryStringQueryBuilder

Set to true if phrase queries will be automatically generated when the analyzer returns more than one term from whitespace delimited text. NOTE: this behavior may not be suitable for all languages. Set to false if phrase queries should only be generated when surrounded by double quotes.

Boost ( float boost ) : QueryStringQueryBuilder

Sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided.

DefaultField ( string defaultField ) : QueryStringQueryBuilder

The default field to run against when no prefix field is specified. Only relevant when not explicitly adding fields the query string will run against.

DefaultOperator ( Operator defaultOperator ) : QueryStringQueryBuilder

Sets the boolean operator of the query parser used to parse the query string. In default mode ({@link FieldQueryBuilder.Operator#OR}) terms without any modifiers are considered optional: for example capital of Hungary is equal to capital OR of OR Hungary. In {@link FieldQueryBuilder.Operator#AND} mode terms are considered to be in conjunction: the above mentioned query is parsed as capital AND of AND Hungary

EnablePositionIncrements ( bool enablePositionIncrements ) : QueryStringQueryBuilder

Set to true to enable position increments in result query. Defaults to true. When set, result phrase and multi-phrase queries will be aware of position increments. Useful when e.g. a StopFilter increases the position increment of the token that follows an omitted token.

Field ( string field ) : QueryStringQueryBuilder

Adds a field to run the query string against.

Field ( string field, float boost ) : QueryStringQueryBuilder

Adds a field to run the query string against with a specific boost.

FuzzyMinSim ( float fuzzyMinSim ) : QueryStringQueryBuilder

Set the minimum similarity for fuzzy queries. Default is 0.5f.

FuzzyPrefixLength ( int fuzzyPrefixLength ) : QueryStringQueryBuilder

Set the minimum similarity for fuzzy queries. Default is 0.5f.

LowercaseExpandedTerms ( bool lowercaseExpandedTerms ) : QueryStringQueryBuilder

Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically lower-cased or not. Default is true.

MinimumShouldMatch ( string minimumShouldMatch ) : QueryStringQueryBuilder
PhraseSlop ( int phraseSlop ) : QueryStringQueryBuilder

Sets the default slop for phrases. If zero, then exact phrase matches are required. Default value is zero.

QueryStringQueryBuilder ( string querystring ) : System
Rewrite ( string rewrite ) : QueryStringQueryBuilder
TieBreaker ( float tieBreaker ) : QueryStringQueryBuilder

When more than one field is used with the query string, and combined queries are using dis max, control the tie breaker for it.

ToJsonObject ( ) : object
ToString ( ) : string
UseDisMax ( bool useDisMax ) : QueryStringQueryBuilder

When more than one field is used with the query string, should queries be combined using dis max, or boolean query. Defaults to dis max (true).

Method Details

AllowLeadingWildcard() public méthode

Should leading wildcards be allowed or not. Defaults to true.
public AllowLeadingWildcard ( bool allowLeadingWildcard ) : QueryStringQueryBuilder
allowLeadingWildcard bool
Résultat QueryStringQueryBuilder

AnalyzeWildcard() public méthode

Set to true to enable analysis on wildcard and prefix queries.
public AnalyzeWildcard ( bool analyzeWildcard ) : QueryStringQueryBuilder
analyzeWildcard bool
Résultat QueryStringQueryBuilder

Analyzer() public méthode

The optional analyzer used to analyze the query string. Note, if a field has search analyzer defined for it, then it will be used automatically. Defaults to the smart search analyzer.
public Analyzer ( string analyzer ) : QueryStringQueryBuilder
analyzer string
Résultat QueryStringQueryBuilder

AutoGeneratePhraseQueries() public méthode

Set to true if phrase queries will be automatically generated when the analyzer returns more than one term from whitespace delimited text. NOTE: this behavior may not be suitable for all languages. Set to false if phrase queries should only be generated when surrounded by double quotes.
public AutoGeneratePhraseQueries ( bool autoGeneratePhraseQueries ) : QueryStringQueryBuilder
autoGeneratePhraseQueries bool
Résultat QueryStringQueryBuilder

Boost() public méthode

Sets the boost for this query. Documents matching this query will (in addition to the normal weightings) have their score multiplied by the boost provided.
public Boost ( float boost ) : QueryStringQueryBuilder
boost float
Résultat QueryStringQueryBuilder

DefaultField() public méthode

The default field to run against when no prefix field is specified. Only relevant when not explicitly adding fields the query string will run against.
public DefaultField ( string defaultField ) : QueryStringQueryBuilder
defaultField string
Résultat QueryStringQueryBuilder

DefaultOperator() public méthode

Sets the boolean operator of the query parser used to parse the query string. In default mode ({@link FieldQueryBuilder.Operator#OR}) terms without any modifiers are considered optional: for example capital of Hungary is equal to capital OR of OR Hungary. In {@link FieldQueryBuilder.Operator#AND} mode terms are considered to be in conjunction: the above mentioned query is parsed as capital AND of AND Hungary
public DefaultOperator ( Operator defaultOperator ) : QueryStringQueryBuilder
defaultOperator Operator
Résultat QueryStringQueryBuilder

EnablePositionIncrements() public méthode

Set to true to enable position increments in result query. Defaults to true. When set, result phrase and multi-phrase queries will be aware of position increments. Useful when e.g. a StopFilter increases the position increment of the token that follows an omitted token.
public EnablePositionIncrements ( bool enablePositionIncrements ) : QueryStringQueryBuilder
enablePositionIncrements bool
Résultat QueryStringQueryBuilder

Field() public méthode

Adds a field to run the query string against.
public Field ( string field ) : QueryStringQueryBuilder
field string
Résultat QueryStringQueryBuilder

Field() public méthode

Adds a field to run the query string against with a specific boost.
public Field ( string field, float boost ) : QueryStringQueryBuilder
field string
boost float
Résultat QueryStringQueryBuilder

FuzzyMinSim() public méthode

Set the minimum similarity for fuzzy queries. Default is 0.5f.
public FuzzyMinSim ( float fuzzyMinSim ) : QueryStringQueryBuilder
fuzzyMinSim float
Résultat QueryStringQueryBuilder

FuzzyPrefixLength() public méthode

Set the minimum similarity for fuzzy queries. Default is 0.5f.
public FuzzyPrefixLength ( int fuzzyPrefixLength ) : QueryStringQueryBuilder
fuzzyPrefixLength int
Résultat QueryStringQueryBuilder

LowercaseExpandedTerms() public méthode

Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically lower-cased or not. Default is true.
public LowercaseExpandedTerms ( bool lowercaseExpandedTerms ) : QueryStringQueryBuilder
lowercaseExpandedTerms bool
Résultat QueryStringQueryBuilder

MinimumShouldMatch() public méthode

public MinimumShouldMatch ( string minimumShouldMatch ) : QueryStringQueryBuilder
minimumShouldMatch string
Résultat QueryStringQueryBuilder

PhraseSlop() public méthode

Sets the default slop for phrases. If zero, then exact phrase matches are required. Default value is zero.
public PhraseSlop ( int phraseSlop ) : QueryStringQueryBuilder
phraseSlop int
Résultat QueryStringQueryBuilder

QueryStringQueryBuilder() public méthode

public QueryStringQueryBuilder ( string querystring ) : System
querystring string
Résultat System

Rewrite() public méthode

public Rewrite ( string rewrite ) : QueryStringQueryBuilder
rewrite string
Résultat QueryStringQueryBuilder

TieBreaker() public méthode

When more than one field is used with the query string, and combined queries are using dis max, control the tie breaker for it.
public TieBreaker ( float tieBreaker ) : QueryStringQueryBuilder
tieBreaker float
Résultat QueryStringQueryBuilder

ToJsonObject() public méthode

public ToJsonObject ( ) : object
Résultat object

ToString() public méthode

public ToString ( ) : string
Résultat string

UseDisMax() public méthode

When more than one field is used with the query string, should queries be combined using dis max, or boolean query. Defaults to dis max (true).
public UseDisMax ( bool useDisMax ) : QueryStringQueryBuilder
useDisMax bool
Résultat QueryStringQueryBuilder