C# Class Rubber.DSL.SearchBuilder

A search source builder allowing to easily build search source. Simple construction using {@link org.elasticsearch.search.builder.SearchSourceBuilder#searchSource()}.
Inheritance: IJsonSerializable
Datei anzeigen Open project: stephenpope/Rubber Class Usage Examples

Public Methods

Method Description
Builder ( ) : SearchBuilder

A static factory method to construct a new search builder.

Explain ( bool explain ) : SearchBuilder

Should each {@link org.elasticsearch.search.SearchHit} be returned with an explanation of the hit (ranking).

Facet ( AbstractFacetBuilder facet ) : SearchBuilder

Add a facet to perform as part of the search.

Facets ( byte facetsBinary ) : SearchBuilder

Sets raw (json) facets.

Facets ( byte facetsBinary, int facetBinaryOffset, int facetBinaryLength ) : SearchBuilder

Sets raw (json) facets.

Field ( string field ) : SearchBuilder

Adds a field to load and return (note, it must be stored) as part of the search request. If none are specified, the source of the document will be return.

Fields ( ) : SearchBuilder

Sets the fields to load and return as part of the search request. If none are specified, the source of the document will be returned.

Fields ( List fields ) : SearchBuilder

Sets the fields to load and return as part of the search request. If none are specified, the source of the document will be returned.

Filter ( IFilterBuilder filter ) : SearchBuilder
Filter ( byte filter ) : SearchBuilder

Sets a filter on the query executed that only applies to the search query (and not facets for example).

Filter ( byte filterBinary, int filterBinaryOffset, int filterBinaryLength ) : SearchBuilder

Sets a filter on the query executed that only applies to the search query (and not facets for example).

Filter ( string filterString ) : SearchBuilder

Sets a filter on the query executed that only applies to the search query (and not facets for example).

From ( int from ) : SearchBuilder

From index to start the search from. Defaults to 0.

Highlight ( ) : HighlightBuilder

A static factory method to construct new search highlights.

Highlight ( HighlightBuilder highlight ) : SearchBuilder

Adds highlight to perform as part of the search.

Highlighter ( ) : HighlightBuilder

IndexBoost ( string index, float indexBoost ) : SearchBuilder

Sets the boost a specific index will receive when the query is executeed against it.

MinScore ( float minScore ) : SearchBuilder

Sets the minimum score below which docs will be filtered out.

NoFields ( ) : SearchBuilder

Sets no fields to be loaded, resulting in only id and type to be returned per field.

Query ( IQueryBuilder query ) : SearchBuilder

Constructs a new search source builder with a search query.

Query ( byte queryBinary ) : SearchBuilder

Constructs a new search source builder with a raw search query.

Query ( byte queryBinary, int queryBinaryOffset, int queryBinaryLength ) : SearchBuilder

Constructs a new search source builder with a raw search query.

Query ( string queryString ) : SearchBuilder

Constructs a new search source builder with a raw search query.

ScriptField ( string name, string script ) : SearchBuilder

Adds a script field under the given name with the provided script.

ScriptField ( string name, string script, object>.Dictionary @params ) : SearchBuilder

Adds a script field.

ScriptField ( string name, string lang, string script, object>.Dictionary @params ) : SearchBuilder

Adds a script field.

SearchSource ( ) : SearchBuilder

A static factory method to construct a new search source.

Size ( int size ) : SearchBuilder

The number of search hits to return. Defaults to 10.

Sort ( ISortBuilder sort ) : SearchBuilder

Adds a sort builder.

Sort ( string name ) : SearchBuilder

Add a sort against the given field name.

Sort ( string name, SortOrder order ) : SearchBuilder

Adds a sort against the given field name and the sort ordering.

Stats ( ) : SearchBuilder

The stats groups this request will be aggregated under.

ToJsonObject ( ) : object
ToString ( ) : string
TrackScores ( bool trackScores ) : SearchBuilder

Applies when sorting, and controls if scores will be tracked as well. Defaults to false.

Version ( bool version ) : SearchBuilder

Should each {@link org.elasticsearch.search.SearchHit} be returned with a version associated with it.

Method Details

Builder() public static method

A static factory method to construct a new search builder.
public static Builder ( ) : SearchBuilder
return SearchBuilder

Explain() public method

Should each {@link org.elasticsearch.search.SearchHit} be returned with an explanation of the hit (ranking).
public Explain ( bool explain ) : SearchBuilder
explain bool
return SearchBuilder

Facet() public method

Add a facet to perform as part of the search.
public Facet ( AbstractFacetBuilder facet ) : SearchBuilder
facet Rubber.DSL.Facet.AbstractFacetBuilder
return SearchBuilder

Facets() public method

Sets raw (json) facets.
public Facets ( byte facetsBinary ) : SearchBuilder
facetsBinary byte
return SearchBuilder

Facets() public method

Sets raw (json) facets.
public Facets ( byte facetsBinary, int facetBinaryOffset, int facetBinaryLength ) : SearchBuilder
facetsBinary byte
facetBinaryOffset int
facetBinaryLength int
return SearchBuilder

Field() public method

Adds a field to load and return (note, it must be stored) as part of the search request. If none are specified, the source of the document will be return.
public Field ( string field ) : SearchBuilder
field string
return SearchBuilder

Fields() public method

Sets the fields to load and return as part of the search request. If none are specified, the source of the document will be returned.
public Fields ( ) : SearchBuilder
return SearchBuilder

Fields() public method

Sets the fields to load and return as part of the search request. If none are specified, the source of the document will be returned.
public Fields ( List fields ) : SearchBuilder
fields List
return SearchBuilder

Filter() public method

public Filter ( IFilterBuilder filter ) : SearchBuilder
filter IFilterBuilder
return SearchBuilder

Filter() public method

Sets a filter on the query executed that only applies to the search query (and not facets for example).
public Filter ( byte filter ) : SearchBuilder
filter byte
return SearchBuilder

Filter() public method

Sets a filter on the query executed that only applies to the search query (and not facets for example).
public Filter ( byte filterBinary, int filterBinaryOffset, int filterBinaryLength ) : SearchBuilder
filterBinary byte
filterBinaryOffset int
filterBinaryLength int
return SearchBuilder

Filter() public method

Sets a filter on the query executed that only applies to the search query (and not facets for example).
public Filter ( string filterString ) : SearchBuilder
filterString string
return SearchBuilder

From() public method

From index to start the search from. Defaults to 0.
public From ( int from ) : SearchBuilder
from int
return SearchBuilder

Highlight() public static method

A static factory method to construct new search highlights.
public static Highlight ( ) : HighlightBuilder
return HighlightBuilder

Highlight() public method

Adds highlight to perform as part of the search.
public Highlight ( HighlightBuilder highlight ) : SearchBuilder
highlight HighlightBuilder
return SearchBuilder

Highlighter() public method

public Highlighter ( ) : HighlightBuilder
return HighlightBuilder

IndexBoost() public method

Sets the boost a specific index will receive when the query is executeed against it.
public IndexBoost ( string index, float indexBoost ) : SearchBuilder
index string The index to apply the boost against
indexBoost float The boost to apply to the index
return SearchBuilder

MinScore() public method

Sets the minimum score below which docs will be filtered out.
public MinScore ( float minScore ) : SearchBuilder
minScore float
return SearchBuilder

NoFields() public method

Sets no fields to be loaded, resulting in only id and type to be returned per field.
public NoFields ( ) : SearchBuilder
return SearchBuilder

Query() public method

Constructs a new search source builder with a search query.
public Query ( IQueryBuilder query ) : SearchBuilder
query IQueryBuilder
return SearchBuilder

Query() public method

Constructs a new search source builder with a raw search query.
public Query ( byte queryBinary ) : SearchBuilder
queryBinary byte
return SearchBuilder

Query() public method

Constructs a new search source builder with a raw search query.
public Query ( byte queryBinary, int queryBinaryOffset, int queryBinaryLength ) : SearchBuilder
queryBinary byte
queryBinaryOffset int
queryBinaryLength int
return SearchBuilder

Query() public method

Constructs a new search source builder with a raw search query.
public Query ( string queryString ) : SearchBuilder
queryString string
return SearchBuilder

ScriptField() public method

Adds a script field under the given name with the provided script.
public ScriptField ( string name, string script ) : SearchBuilder
name string The name of the field
script string The script
return SearchBuilder

ScriptField() public method

Adds a script field.
public ScriptField ( string name, string script, object>.Dictionary @params ) : SearchBuilder
name string The name of the field
script string The script to execute
@params object>.Dictionary
return SearchBuilder

ScriptField() public method

Adds a script field.
public ScriptField ( string name, string lang, string script, object>.Dictionary @params ) : SearchBuilder
name string The name of the field
lang string The language of the script
script string The script to execute
@params object>.Dictionary
return SearchBuilder

SearchSource() public static method

A static factory method to construct a new search source.
public static SearchSource ( ) : SearchBuilder
return SearchBuilder

Size() public method

The number of search hits to return. Defaults to 10.
public Size ( int size ) : SearchBuilder
size int
return SearchBuilder

Sort() public method

Adds a sort builder.
public Sort ( ISortBuilder sort ) : SearchBuilder
sort ISortBuilder
return SearchBuilder

Sort() public method

Add a sort against the given field name.
public Sort ( string name ) : SearchBuilder
name string
return SearchBuilder

Sort() public method

Adds a sort against the given field name and the sort ordering.
public Sort ( string name, SortOrder order ) : SearchBuilder
name string The name of the field
order SortOrder The sort ordering
return SearchBuilder

Stats() public method

The stats groups this request will be aggregated under.
public Stats ( ) : SearchBuilder
return SearchBuilder

ToJsonObject() public method

public ToJsonObject ( ) : object
return object

ToString() public method

public ToString ( ) : string
return string

TrackScores() public method

Applies when sorting, and controls if scores will be tracked as well. Defaults to false.
public TrackScores ( bool trackScores ) : SearchBuilder
trackScores bool
return SearchBuilder

Version() public method

Should each {@link org.elasticsearch.search.SearchHit} be returned with a version associated with it.
public Version ( bool version ) : SearchBuilder
version bool
return SearchBuilder