# Use live search or tending search results to boost results. (Suggestions needed)

**URL:** <https://discuss.elastic.co/t/use-live-search-or-tending-search-results-to-boost-results-suggestions-needed/190559>\
**Category:** Elasticsearch\
**Created:** [July 15, 2019, 2:15pm UTC](https://discuss.elastic.co/t/use-live-search-or-tending-search-results-to-boost-results-suggestions-needed/190559 "2019-07-15T14:15:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![WildVictor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wildvictor/32/49985_2.png) [@WildVictor](https://discuss.elastic.co/u/WildVictor)\
**Post date:** [July 15, 2019, 2:15pm UTC](https://discuss.elastic.co/t/use-live-search-or-tending-search-results-to-boost-results-suggestions-needed/190559/1 "2019-07-15T14:15:32Z")

</div>

I'm looking for suggestion on how to improve my current prototype. Basically I'm happy with my search results based on text matching (analyzer). Now however I would also like to boost results if they are popular.

Let's say my search result contains documents in the following order name (score):

```
- League of Legends (102.34)
- Apex Legends (101.12)
- EVE Legens (101.09)
- Legends of Azeroth (101.01)

```

However today **Apex Legends** had a new update and a lot of people are searching for it I would like it moved to the top. **Legends of Azeroth** also had a lot of searches yesterday so I would like to boost it up as well.

What I'm currently doing is I have two indices one for data and one for hits. I return a result set to the first user as shown above the user in their app clicks on one of the results in this case **Apex Legends** and when they do that they call my API which than stores a new entry in the hits indice.

The entry is basically `{ "id": "...", "timestamp": ... }`.

Now when the second user does the similar/same search i first do a query on data indice and I get the result as above. Than I take ID's of top 3-5 result entries and do a query on hit indice and I sort the result set by the number of hits they had in the last 12-24h.

**This however is a bit on a messy/slow side.** As I can't just push documents directly out of ES to user but have a java method in between which needs to parse the results do another query, sort the results and than serialize and sent them to the user.

**Alternative idea** is I add a property to all my documents called `trending`. Then each time user selects document as search result I increase this `trending` value. I can than use field value factor to boost by this value.

However each day I would have to refresh my indice and set all these values back down to 0 or half. My indice is pretty massive so this would take quite some time. And on top of that I would not be able to get data such as how popular was some hit during certain time of the year/month/week/day as I would with a hit indice.

Any suggestions are very welcome.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 12, 2019, 2:15pm UTC](https://discuss.elastic.co/t/use-live-search-or-tending-search-results-to-boost-results-suggestions-needed/190559/2 "2019-08-12T14:15:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
