Use SQL to get SearchBlox top queries and top viewed documents directly from Elasticsearch

Important Information:

Credentials for Elasticsearch https://localhost:9200 Username : admin Password: xxxxx

## **Query Logs**

The query logs in elasticsearch can be downloaded in CSV using the following SQL:



The search queries can be downloaded using the following SQL:



You can get the number of hits for each query from elasticsearch using the following SQL:



## **Most Popular Search Results**

The most popular or top-viewed search results can be downloaded in CSV using the following SQL:



You can get the URL and number of times they will clicked from elasticsearch search results in CSV using the following SQL:



Using SQL, you can filter and search the data from elasticsearch. For examples, please refer [Using SQL in Elasticsearch](🔗)