How to make the largest vertex matching element in ElasticSearch query results

I use ElasticSearch to create an e-commerce search engine like nexttag.com or thefind.com .

There is such an element as:

  • Case for iPhone 6 - iPhone 6 Wallet for iPhone, Leather Case for iPhone 6, Leather Case with Flip Wallet with Credit Card Holder for Apple iPhone 6 4.7 '' Black
  • iPhone 6/6 Plus Quick Starter Guide: (for iPhone 4, iPhone 5, iPhone 5 and iPhone 5c, iPhone 6, iPhone 6 +
  • iPhone 6 Case, iPhone 6 (4.7) Flip Case [Hybrid Series] [Wallet] - Leather Case for iPhone 6 (4.7) - Kickbox Stand (PULPC-G-001) iPhone 6 (4.7in) Brown
  • Apple iPhone 6 Gold 16 GB (Unlocked)

When we request “iPhone 6,” how can I make an “Apple iPhone” at the top, or not an “iPhone-case” or “iPhone-Guide for iPhone”.

+4
source share
1 answer

I would suggest you use the function request functionality offered by elasticsearch. The score function allows you to change the number of documents received on request.

In short, what you are doing is to add some post-processing of the search results by changing the rating of each document using the special function (or additional functions) that you provide.

You have various options for implementing the evaluation function, and your choice should depend on your specific case.

, field_value_factor, , . , (, "boost_factor" 1,5 1.0 - ). , .

field_value_factor": {
  "field": "boost_factor",
  "factor": 1.0,
  "modifier": "none"
}

:

1.0 * doc['popularity'].value

, , , : https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#query-dsl-function-score-query

+2

All Articles