Solr - How to index and boost results using several popularity fields?

75 Views Asked by At

Here is a sample document -

{
    "id": "AIRPORT-LAS",
    "RANK": 80.0,
    "TYPE": "AIRPORT",
    "COUNTRY_NAME": "United States",
    "COUNTRY_CODE": "US",
    "ISO_COUNTRY_CODE": "US",
    "LATITUDE": "36.08047103880001",
    "LONGITUDE": "-115.14331054699983",
    "LATLON": [
        "36.08047103880001,-115.14331054699983"
    ],
    "CITY_CODE": "LAS",
    "CITY_NAME": "Las Vegas",
    "PROVINCE_CODE": "NV",
    "PROVINCE_NAME": "NEVADA",
    "AIRPORT_NAME": "McCarran Intl Airport",
    "AIRPORT_CODE": "LAS"
}

Now based on where (geographic location) the customer is searching, I'll be having several RANK(s) using State and Country combinations for each of the above documents.

For example -

For AIRPORT-LAS, I'll have the following -
USA - CA - 100
USA - NJ - 80
USA - NY - 75
.... rest of combinations

I am trying to understand the following -

  1. What is the best way to index this new set of ranks to the existing documents? As a separate collection? Or as a nested data set?
  2. How can I boost my results using the new set of ranks at search time? [so basically, if the user is searching from USA - CA, I should be using RANK=100, to boost my search results. I would know the State and Country at search time.]

Thank You!

1

There are 1 best solutions below

0
On

If you want to integrate numeric document values directly into the score, use a boost function on query time. You may also use multiple document values here, but watch out to select an adequate boost factor.

bf=mul(RANK, 2)