C# Class Rubber.DSL.QueryFactory

ファイルを表示 Open project: stephenpope/Rubber

Public Methods

Method Description
BoolQuery ( ) : BoolQueryBuilder

A Query that matches documents matching boolean combinations of other queries.

BoostingQuery ( ) : BoostingQueryBuilder

The BoostingQuery class can be used to effectively demote results that match a given query. Unlike the "NOT" clause, this still selects documents that contain undesirable terms, but reduces their overall score:

ConstantScoreQuery ( IFilterBuilder filterBuilder ) : ConstantScoreQueryBuilder

A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.

CustomBoostFactorQuery ( IQueryBuilder queryBuilder ) : CustomBoostFactorQueryBuilder

A query that simply applies the boost fact to the wrapped query (multiplies it).

CustomFiltersScoreQuery ( IQueryBuilder queryBuilder ) : CustomFiltersScoreQueryBuilder
CustomScoreQuery ( IQueryBuilder queryBuilder ) : CustomScoreQueryBuilder

A query that allows to define a custom scoring script.

DisMaxQuery ( ) : DisMaxQueryBuilder

A query that generates the union of documents produced by its sub-queries, and that scores each document with the maximum score for that document as produced by any sub-query, plus a tie breaking increment for any additional matching sub-queries.

FieldMaskingSpanQuery ( ISpanQueryBuilder query, string field ) : FieldMaskingSpanQueryBuilder
FieldQuery ( string name, bool query ) : FieldQueryBuilder

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.

FieldQuery ( string name, double query ) : FieldQueryBuilder

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.

FieldQuery ( string name, float query ) : FieldQueryBuilder

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.

FieldQuery ( string name, int query ) : FieldQueryBuilder

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.

FieldQuery ( string name, long query ) : FieldQueryBuilder

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.

FieldQuery ( string name, object query ) : FieldQueryBuilder

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.

FieldQuery ( string name, string query ) : FieldQueryBuilder

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.

FilteredQuery ( IQueryBuilder queryBuilder, IFilterBuilder filterBuilder ) : FilteredQueryBuilder

A query that applies a filter to the results of another query.

FuzzyLikeThisFieldQuery ( string name ) : FuzzyLikeThisFieldQueryBuilder

A fuzzy like this query that finds documents that are "like" the provided {@link FuzzyLikeThisFieldQueryBuilder#likeText(String)}.

FuzzyLikeThisQuery ( ) : FuzzyLikeThisQueryBuilder

A fuzzy like this query that finds documents that are "like" the provided {@link FuzzyLikeThisQueryBuilder#likeText(String)} which is checked against the fields the query is constructed with.

FuzzyQuery ( string name, string value ) : FuzzyQueryBuilder

A Query that matches documents using fuzzy query.

HasChildQuery ( string type, IQueryBuilder query ) : HasChildQueryBuilder

Constructs a new NON scoring child query, with the child type and the query to run on the child documents. The results of this query are the parent docs that those child docs matched.

IdsQuery ( ) : IdsQueryBuilder

Constructs a query that will match only specific ids within types.

InQuery ( string name, string prefix ) : PrefixFilterBuilder

A filter that restricts search results to values that have a matching prefix in a given field.

InQuery ( string name ) : TermsQueryBuilder

A filer for a field based on several terms matching on any of them.

IndicesQuery ( IQueryBuilder queryBuilder ) : IndicesQueryBuilder

A query that will execute the wrapped query only for the specified indices, and "match_all" when it does not match those indices.

MatchAllQuery ( ) : MatchAllQueryBuilder

A query that match on all documents.

MoreLikeThisFieldQuery ( string name ) : MoreLikeThisFieldQueryBuilder

A more like this query that runs against a specific field.

MoreLikeThisQuery ( ) : MoreLikeThisQueryBuilder

A more like this query that finds documents that are "like" the provided {@link MoreLikeThisQueryBuilder#likeText(String)} which is checked against the fields the query is constructed with.

NestedQuery ( string path, IQueryBuilder query ) : NestedQueryBuilder
PrefixQuery ( string name, string prefix ) : PrefixQueryBuilder

A Query that matches documents containing terms with a specified prefix.

QueryString ( string queryString ) : 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 QueryStringQueryBuilder#field(String)}, will run the query once and non prefixed fields will use the {@link QueryStringQueryBuilder#defaultField(String)} set. The second, when one or more fields are added (using {@link QueryStringQueryBuilder#field(String)}), will run the parsed query against the provided fields, and combine them either using DisMax or a plain boolean query (see {@link QueryStringQueryBuilder#useDisMax(boolean)}).

RangeQuery ( string name ) : RangeQueryBuilder

A Query that matches documents within an range of terms.

SpanFirstQuery ( ISpanQueryBuilder match, int end ) : SpanFirstQueryBuilder
SpanNearQuery ( ) : SpanNearQueryBuilder
SpanNotQuery ( ) : SpanNotQueryBuilder
SpanOrQuery ( ) : SpanOrQueryBuilder
SpanTermQuery ( string name, double value ) : SpanTermQueryBuilder
SpanTermQuery ( string name, float value ) : SpanTermQueryBuilder
SpanTermQuery ( string name, int value ) : SpanTermQueryBuilder
SpanTermQuery ( string name, long value ) : SpanTermQueryBuilder
SpanTermQuery ( string name, string value ) : SpanTermQueryBuilder
TermQuery ( string name, bool value ) : TermQueryBuilder

A Query that matches documents containing a term.

TermQuery ( string name, double value ) : TermQueryBuilder

A Query that matches documents containing a term.

TermQuery ( string name, float value ) : TermQueryBuilder

A Query that matches documents containing a term.

TermQuery ( string name, int value ) : TermQueryBuilder

A Query that matches documents containing a term.

TermQuery ( string name, long value ) : TermQueryBuilder

A Query that matches documents containing a term.

TermQuery ( string name, object value ) : TermQueryBuilder

A Query that matches documents containing a term.

TermQuery ( string name, string value ) : TermQueryBuilder

A Query that matches documents containing a term.

TermsQuery ( string name ) : TermsQueryBuilder

A filer for a field based on several terms matching on any of them.

TextPhrasePrefixQuery ( string name, object text ) : TextQueryBuilder

Creates a text query with type "PHRASE_PREFIX" for the provided field name and text.

TextPhraseQuery ( string name, object text ) : TextQueryBuilder

Creates a text query with type "PHRASE" for the provided field name and text.

TextQuery ( string name, object text ) : TextQueryBuilder

Creates a text query with type "BOOLEAN" for the provided field name and text.

TopChildrenQuery ( string type, IQueryBuilder query ) : TopChildrenQueryBuilder

Constructs a new scoring child query, with the child type and the query to run on the child documents. The results of this query are the parent docs that those child docs matched.

WildcardQuery ( string name, string query ) : WildcardQueryBuilder

Implements the wildcard search query. Supported wildcards are *, which matches any character sequence (including the empty one), and ?, which matches any single character. Note this query can be slow, as it needs to iterate over many terms. In order to prevent extremely slow WildcardQueries, a Wildcard term should not start with one of the wildcards * or ?.

WrapperQuery ( byte source, int offset, int length ) : WrapperQueryBuilder

A Query builder which allows building a query thanks to a JSON string or binary data.

WrapperQuery ( string source ) : WrapperQueryBuilder

A Query builder which allows building a query thanks to a JSON string or binary data.

Method Details

BoolQuery() public static method

A Query that matches documents matching boolean combinations of other queries.
public static BoolQuery ( ) : BoolQueryBuilder
return Rubber.DSL.Query.BoolQueryBuilder

BoostingQuery() public static method

The BoostingQuery class can be used to effectively demote results that match a given query. Unlike the "NOT" clause, this still selects documents that contain undesirable terms, but reduces their overall score:
public static BoostingQuery ( ) : BoostingQueryBuilder
return Rubber.DSL.Query.BoostingQueryBuilder

ConstantScoreQuery() public static method

A query that wraps a filter and simply returns a constant score equal to the query boost for every document in the filter.
public static ConstantScoreQuery ( IFilterBuilder filterBuilder ) : ConstantScoreQueryBuilder
filterBuilder IFilterBuilder The filter to wrap in a constant score query
return Rubber.DSL.Query.ConstantScoreQueryBuilder

CustomBoostFactorQuery() public static method

A query that simply applies the boost fact to the wrapped query (multiplies it).
public static CustomBoostFactorQuery ( IQueryBuilder queryBuilder ) : CustomBoostFactorQueryBuilder
queryBuilder IQueryBuilder The query to apply the boost factor to.
return Rubber.DSL.Query.CustomBoostFactorQueryBuilder

CustomFiltersScoreQuery() public static method

public static CustomFiltersScoreQuery ( IQueryBuilder queryBuilder ) : CustomFiltersScoreQueryBuilder
queryBuilder IQueryBuilder
return Rubber.DSL.Query.CustomFiltersScoreQueryBuilder

CustomScoreQuery() public static method

A query that allows to define a custom scoring script.
public static CustomScoreQuery ( IQueryBuilder queryBuilder ) : CustomScoreQueryBuilder
queryBuilder IQueryBuilder The query to custom score
return Rubber.DSL.Query.CustomScoreQueryBuilder

DisMaxQuery() public static method

A query that generates the union of documents produced by its sub-queries, and that scores each document with the maximum score for that document as produced by any sub-query, plus a tie breaking increment for any additional matching sub-queries.
public static DisMaxQuery ( ) : DisMaxQueryBuilder
return Rubber.DSL.Query.DisMaxQueryBuilder

FieldMaskingSpanQuery() public static method

public static FieldMaskingSpanQuery ( ISpanQueryBuilder query, string field ) : FieldMaskingSpanQueryBuilder
query ISpanQueryBuilder
field string
return Rubber.DSL.Query.FieldMaskingSpanQueryBuilder

FieldQuery() public static method

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.
public static FieldQuery ( string name, bool query ) : FieldQueryBuilder
name string The name of the field
query bool The query string
return Rubber.DSL.Query.FieldQueryBuilder

FieldQuery() public static method

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.
public static FieldQuery ( string name, double query ) : FieldQueryBuilder
name string The name of the field
query double The query string
return Rubber.DSL.Query.FieldQueryBuilder

FieldQuery() public static method

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.
public static FieldQuery ( string name, float query ) : FieldQueryBuilder
name string The name of the field
query float The query string
return Rubber.DSL.Query.FieldQueryBuilder

FieldQuery() public static method

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.
public static FieldQuery ( string name, int query ) : FieldQueryBuilder
name string The name of the field
query int The query string
return Rubber.DSL.Query.FieldQueryBuilder

FieldQuery() public static method

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.
public static FieldQuery ( string name, long query ) : FieldQueryBuilder
name string The name of the field
query long The query string
return Rubber.DSL.Query.FieldQueryBuilder

FieldQuery() public static method

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.
public static FieldQuery ( string name, object query ) : FieldQueryBuilder
name string The name of the field
query object The query string
return Rubber.DSL.Query.FieldQueryBuilder

FieldQuery() public static method

A query that executes the query string against a field. It is a simplified version of {@link QueryStringQueryBuilder} that simply runs against a single field.
public static FieldQuery ( string name, string query ) : FieldQueryBuilder
name string The name of the field
query string The query string
return Rubber.DSL.Query.FieldQueryBuilder

FilteredQuery() public static method

A query that applies a filter to the results of another query.
public static FilteredQuery ( IQueryBuilder queryBuilder, IFilterBuilder filterBuilder ) : FilteredQueryBuilder
queryBuilder IQueryBuilder The query to apply the filter to
filterBuilder IFilterBuilder The filter to apply on the query
return Rubber.DSL.Query.FilteredQueryBuilder

FuzzyLikeThisFieldQuery() public static method

A fuzzy like this query that finds documents that are "like" the provided {@link FuzzyLikeThisFieldQueryBuilder#likeText(String)}.
public static FuzzyLikeThisFieldQuery ( string name ) : FuzzyLikeThisFieldQueryBuilder
name string
return Rubber.DSL.Query.FuzzyLikeThisFieldQueryBuilder

FuzzyLikeThisQuery() public static method

A fuzzy like this query that finds documents that are "like" the provided {@link FuzzyLikeThisQueryBuilder#likeText(String)} which is checked against the fields the query is constructed with.
public static FuzzyLikeThisQuery ( ) : FuzzyLikeThisQueryBuilder
return Rubber.DSL.Query.FuzzyLikeThisQueryBuilder

FuzzyQuery() public static method

A Query that matches documents using fuzzy query.
public static FuzzyQuery ( string name, string value ) : FuzzyQueryBuilder
name string The name of the field
value string The value of the term
return Rubber.DSL.Query.FuzzyQueryBuilder

HasChildQuery() public static method

Constructs a new NON scoring child query, with the child type and the query to run on the child documents. The results of this query are the parent docs that those child docs matched.
public static HasChildQuery ( string type, IQueryBuilder query ) : HasChildQueryBuilder
type string The child type.
query IQueryBuilder The query.
return Rubber.DSL.Query.HasChildQueryBuilder

IdsQuery() public static method

Constructs a query that will match only specific ids within types.
public static IdsQuery ( ) : IdsQueryBuilder
return Rubber.DSL.Query.IdsQueryBuilder

InQuery() public static method

A filter that restricts search results to values that have a matching prefix in a given field.
public static InQuery ( string name, string prefix ) : PrefixFilterBuilder
name string The field name
prefix string The prefix
return Rubber.DSL.Filter.PrefixFilterBuilder

InQuery() public static method

A filer for a field based on several terms matching on any of them.
public static InQuery ( string name ) : TermsQueryBuilder
name string The field name
return Rubber.DSL.Query.TermsQueryBuilder

IndicesQuery() public static method

A query that will execute the wrapped query only for the specified indices, and "match_all" when it does not match those indices.
public static IndicesQuery ( IQueryBuilder queryBuilder ) : IndicesQueryBuilder
queryBuilder IQueryBuilder
return Rubber.DSL.Query.IndicesQueryBuilder

MatchAllQuery() public static method

A query that match on all documents.
public static MatchAllQuery ( ) : MatchAllQueryBuilder
return Rubber.DSL.Query.MatchAllQueryBuilder

MoreLikeThisFieldQuery() public static method

A more like this query that runs against a specific field.
public static MoreLikeThisFieldQuery ( string name ) : MoreLikeThisFieldQueryBuilder
name string The field name
return Rubber.DSL.Query.MoreLikeThisFieldQueryBuilder

MoreLikeThisQuery() public static method

A more like this query that finds documents that are "like" the provided {@link MoreLikeThisQueryBuilder#likeText(String)} which is checked against the fields the query is constructed with.
public static MoreLikeThisQuery ( ) : MoreLikeThisQueryBuilder
return Rubber.DSL.Query.MoreLikeThisQueryBuilder

NestedQuery() public static method

public static NestedQuery ( string path, IQueryBuilder query ) : NestedQueryBuilder
path string
query IQueryBuilder
return Rubber.DSL.Query.NestedQueryBuilder

PrefixQuery() public static method

A Query that matches documents containing terms with a specified prefix.
public static PrefixQuery ( string name, string prefix ) : PrefixQueryBuilder
name string The name of the field
prefix string The prefix query
return Rubber.DSL.Query.PrefixQueryBuilder

QueryString() public static method

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 QueryStringQueryBuilder#field(String)}, will run the query once and non prefixed fields will use the {@link QueryStringQueryBuilder#defaultField(String)} set. The second, when one or more fields are added (using {@link QueryStringQueryBuilder#field(String)}), will run the parsed query against the provided fields, and combine them either using DisMax or a plain boolean query (see {@link QueryStringQueryBuilder#useDisMax(boolean)}).
public static QueryString ( string queryString ) : QueryStringQueryBuilder
queryString string The query string to run
return Rubber.DSL.Query.QueryStringQueryBuilder

RangeQuery() public static method

A Query that matches documents within an range of terms.
public static RangeQuery ( string name ) : RangeQueryBuilder
name string The field name
return Rubber.DSL.Query.RangeQueryBuilder

SpanFirstQuery() public static method

public static SpanFirstQuery ( ISpanQueryBuilder match, int end ) : SpanFirstQueryBuilder
match ISpanQueryBuilder
end int
return Rubber.DSL.Query.SpanFirstQueryBuilder

SpanNearQuery() public static method

public static SpanNearQuery ( ) : SpanNearQueryBuilder
return Rubber.DSL.Query.SpanNearQueryBuilder

SpanNotQuery() public static method

public static SpanNotQuery ( ) : SpanNotQueryBuilder
return Rubber.DSL.Query.SpanNotQueryBuilder

SpanOrQuery() public static method

public static SpanOrQuery ( ) : SpanOrQueryBuilder
return Rubber.DSL.Query.SpanOrQueryBuilder

SpanTermQuery() public static method

public static SpanTermQuery ( string name, double value ) : SpanTermQueryBuilder
name string
value double
return Rubber.DSL.Query.SpanTermQueryBuilder

SpanTermQuery() public static method

public static SpanTermQuery ( string name, float value ) : SpanTermQueryBuilder
name string
value float
return Rubber.DSL.Query.SpanTermQueryBuilder

SpanTermQuery() public static method

public static SpanTermQuery ( string name, int value ) : SpanTermQueryBuilder
name string
value int
return Rubber.DSL.Query.SpanTermQueryBuilder

SpanTermQuery() public static method

public static SpanTermQuery ( string name, long value ) : SpanTermQueryBuilder
name string
value long
return Rubber.DSL.Query.SpanTermQueryBuilder

SpanTermQuery() public static method

public static SpanTermQuery ( string name, string value ) : SpanTermQueryBuilder
name string
value string
return Rubber.DSL.Query.SpanTermQueryBuilder

TermQuery() public static method

A Query that matches documents containing a term.
public static TermQuery ( string name, bool value ) : TermQueryBuilder
name string The name of the field
value bool The value of the term
return Rubber.DSL.Query.TermQueryBuilder

TermQuery() public static method

A Query that matches documents containing a term.
public static TermQuery ( string name, double value ) : TermQueryBuilder
name string The name of the field
value double The value of the term
return Rubber.DSL.Query.TermQueryBuilder

TermQuery() public static method

A Query that matches documents containing a term.
public static TermQuery ( string name, float value ) : TermQueryBuilder
name string The name of the field
value float The value of the term
return Rubber.DSL.Query.TermQueryBuilder

TermQuery() public static method

A Query that matches documents containing a term.
public static TermQuery ( string name, int value ) : TermQueryBuilder
name string The name of the field
value int The value of the term
return Rubber.DSL.Query.TermQueryBuilder

TermQuery() public static method

A Query that matches documents containing a term.
public static TermQuery ( string name, long value ) : TermQueryBuilder
name string The name of the field
value long The value of the term
return Rubber.DSL.Query.TermQueryBuilder

TermQuery() public static method

A Query that matches documents containing a term.
public static TermQuery ( string name, object value ) : TermQueryBuilder
name string The name of the field
value object The value of the term
return Rubber.DSL.Query.TermQueryBuilder

TermQuery() public static method

A Query that matches documents containing a term.
public static TermQuery ( string name, string value ) : TermQueryBuilder
name string The name of the field
value string The value of the term
return Rubber.DSL.Query.TermQueryBuilder

TermsQuery() public static method

A filer for a field based on several terms matching on any of them.
public static TermsQuery ( string name ) : TermsQueryBuilder
name string The field name
return Rubber.DSL.Query.TermsQueryBuilder

TextPhrasePrefixQuery() public static method

Creates a text query with type "PHRASE_PREFIX" for the provided field name and text.
public static TextPhrasePrefixQuery ( string name, object text ) : TextQueryBuilder
name string The field name.
text object The query text (to be analyzed).
return Rubber.DSL.Query.TextQueryBuilder

TextPhraseQuery() public static method

Creates a text query with type "PHRASE" for the provided field name and text.
public static TextPhraseQuery ( string name, object text ) : TextQueryBuilder
name string The field name.
text object The query text (to be analyzed).
return Rubber.DSL.Query.TextQueryBuilder

TextQuery() public static method

Creates a text query with type "BOOLEAN" for the provided field name and text.
public static TextQuery ( string name, object text ) : TextQueryBuilder
name string The field name.
text object The query text (to be analyzed).
return Rubber.DSL.Query.TextQueryBuilder

TopChildrenQuery() public static method

Constructs a new scoring child query, with the child type and the query to run on the child documents. The results of this query are the parent docs that those child docs matched.
public static TopChildrenQuery ( string type, IQueryBuilder query ) : TopChildrenQueryBuilder
type string The child type
query IQueryBuilder The query
return Rubber.DSL.Query.TopChildrenQueryBuilder

WildcardQuery() public static method

Implements the wildcard search query. Supported wildcards are *, which matches any character sequence (including the empty one), and ?, which matches any single character. Note this query can be slow, as it needs to iterate over many terms. In order to prevent extremely slow WildcardQueries, a Wildcard term should not start with one of the wildcards * or ?.
public static WildcardQuery ( string name, string query ) : WildcardQueryBuilder
name string The field name
query string The wildcard query string
return Rubber.DSL.Query.WildcardQueryBuilder

WrapperQuery() public static method

A Query builder which allows building a query thanks to a JSON string or binary data.
public static WrapperQuery ( byte source, int offset, int length ) : WrapperQueryBuilder
source byte
offset int
length int
return Rubber.DSL.Query.WrapperQueryBuilder

WrapperQuery() public static method

A Query builder which allows building a query thanks to a JSON string or binary data.
public static WrapperQuery ( string source ) : WrapperQueryBuilder
source string
return Rubber.DSL.Query.WrapperQueryBuilder