简体   繁体   中英

Configure Elastic Search Result Scoring

Is it possible to configure or otherwise alter how Elastic Search scores its results?

When running a search for "term" using the NativeSearchQueryBuilder documents that contain one instance of the term are all scored the same. This makes sense. However one of the documents contain just the term, where are the others contain term and other data. For example;

Doc1: Title : Space

Doc2: Title : Space Time

Doc3: Title : No Space

So when searching for Space is there anyway to make Doc1 score more highly?

-Edit So, a little more detail following briarheart's response. I think the problem is the way we're implementing typeahead searches. If I run the Space query using our standard search the ranking is as outlined by briarheart, but our typeahead scores everything equally because we are using the wildcard request part and looking for "term*" so "Space" and "Space Lane" do both match that equally well.

So really I guess I'm asking the wrong question. Scoring is working as it should, I just need to figure out a better implementation of type ahead.

(The Suggest Request Part doesn't seem to fit the use case as this would involve picking and resubmitting the desired suggestion).

I do not know how exactly does look like your query but actually in case of using full text search of the term "Space" the document "Doc1" from your example will get the highest score because of length of its "Title" field. Shorter fields have more weight in terms of relevance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM