Struct elasticsearch_dsl::search::rescoring::Rescore [−][src]
pub struct Rescore { /* fields omitted */ }Expand description
Rescoring can help to improve precision by reordering just the top (eg 100 - 500) documents returned by the query and post_filter phases, using a secondary (usually more costly) algorithm, instead of applying the costly algorithm to all documents in the index.
A rescore request is executed on each shard before it returns its results to be sorted by the node handling the overall search request.
Currently the rescore API has only one implementation: the query rescorer, which uses a query to tweak the scoring. In the future, alternative rescorers may be made available, for example, a pair-wise rescorer.
To create a rescore query with simple term query:
Rescore::new(Query::term("title", "test"));To create a rescore query with simple term query and optional fields:
Rescore::new(Query::term("title", "test"))
.rescore_query_weight(0.2)
.window_size(100);https://www.elastic.co/guide/en/elasticsearch/reference/current/filter-search-results.html#rescore
Implementations
Creates a new instance of Rescore
query- Second query which will be execute on top-k results returned by original query.
The number of docs which will be examined on each shard can be controlled by the window_size parameter, which defaults to 10.
The relative importance of the rescore query can be controlled with the rescore_query_weight respectively. Both default to 1.
The relative importance of the original query can be controlled with the query_weight respectively. Both default to 1.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Rescore
impl UnwindSafe for Rescore
Blanket Implementations
Mutably borrows from an owned value. Read more