Finding related search queries from Elasticsearch

In many search engines, for a given query, it often shows "related searches". There are two kinds of related searches, one is adjacent search queries, and one is adjacent phrases. Like in Google, for the query "elasticsearch find related searches", we get two kinds of adjacent searches in web search results and image search results:


Any idea how to make Elasticsearch give us such adjacent search queries and phrases for a given query, assuming it is loaded with massive amounr of web crawl data?

Hi Don,

Do you have a massive amount of query + click data too? Examining the clicked links for historical queries can reveal the other search terms that led people to those same links.

Elasticsearch itself does not track queries so this is something you would need to build on top of Elasticsearch yourself.