Pinned Query

Hello All,

I am trying the Elasticsearch pinned query, for that, I have some questions:

  1. Is there any analytics tool elasticsearch plugin or built-in functionality to find out the most searched terms?
  2. Is there any way to store pinned ids based on the search query in elasticsearch?

My use case scenario is I want to use pinned query as a recommendation for example:-

A bookstore that sells a series of course books

Search term: name of the book series
Pinned results: search results containing relevant books from the series

GET /book_store/_search
{
    		"query": {
        		"pinned" : {
            		"ids" : ["1", "4", "100"],
            		"organic" : {
            			"match":{
            				"book_name": "The art of living"
            			}
            		}
        		}
    		}
}

Regards,
Avinash Kumawat

There isn’t one way to determine what should be pinned which is why we don’t offer one out of the box. You’ll need to build something that suits your needs but we do have features that can help.

If you store user search strings an index as a ‘keyword’ field type you can use the ‘terms’ aggregation to find the most popular ones. I’d recommend also storing the ids of products they clicked on and their positions in the search results. This will help determine which products might be useful to pin to the top of search results.

Yes, like anything else these would be JSON documents in an index.

You might also be interested in examining user behaviours using the Graph tool. At 27 minutes into this video I demonstrate looking at click data Graph Capabilities in the Elastic Stack | Elastic

Thanks Mark, i will try this out and will update you if this works for me.

1 Like

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