Top Clicked or Viewed data is stored in Elasticsearch with the index name idx9998. The index would be listed here as in the screenshot: [https://localhost:9200/_cat/indices](🔗).

From 9.2 onwards we also have one more index called click where we store individual URLs and the click count for the same.

553

  • The data in the index can be accessed here: [https://localhost:9200/idx9998/_search?pretty=true](🔗) [https://localhost:9200/click/_search?pretty=true](🔗)

698


idx9998 index output

808


click index output

Important Note:

  • Only documents or URLs clicked from Faceted Search can be recorded in Top Clicked index.

  • Not applicable for regular search results.

## **Viewing Top Viewed/Clicked Results in Kibana**

  • Top Clicked Results are stored in a separate index, called idx9998, within Elasticsearch in SearchBlox. Kibana can be used to view these Top Clicked Results, search these results, and generate reports based on the Top Clicked Results.

  • The index query name that has to be added in Kibana is `idx9998` for Top Clicked Results.

  • If you want to add index 'click' you can add that name using the following steps:

1341

1350

1345

  • Top Clicked results can be viewed and searched after adding index idx9998 in Kibana.

1341




To get to know more about Kibana in SearchBlox please check the following link: [Kibana Visualizations](🔗) and Explore

## **Top Clicked Data Analysis**

### API to Increment Click Count from Search

  • SearchBlox uses the following API URL to ReportServlet to increase the click count.

  • The click count will be incremented in the indexed document as well as click log index idx9998.

  • We also update in one more index called click which is available from version 9.2 onwards. https://localhost:8443/searchblox/servlet/ReportServlet?addclick=yes&col=10&query=test&title=title&uid=11b77586c75556e161a6a71a451d6744&url=https://www.searchblox.com

parametersDescription
addclickyes The value for this field should be yes
colcollection number
querySearch query
titletitle of the document from JSON results
uiduid of the document from JSON results
urlurl of the document from JSON results

### Integration of the Search Click Count API in Faceted Search

Using Axios we are calling those API's in `plugin\src\sb\Common\SbCore.js` We are providing the sample code here so that you can use something similar for your custom search at your end.



### API for Capturing AutoSuggest Click Count

  • SearchBlox uses the following API URL to ReportServlet to update the autosuggest click count https://localhost:8443/searchblox/servlet/ReportServlet?addsuggest=yes&query=test&suggestion=test

  • If there is collection parameter in the URL that can be sent using the parameter col as shown: https://localhost:8443/searchblox/servlet/ReportServlet?addsuggest=yes&query=test&suggestion=test&col=1

ParameterDescription
addsuggestyes The value for this field should be yes
querysearch query
suggestionsearch suggestion
colcollection number

### Integration of the Autosuggest click API in Faceted Search

Using axios we are calling those API's in `plugin\src\sb\Common\SbCore.js` We are providing the sample code here so that you can use something similar for your custom search at your end.



## **Deleting or Clearing Data for Top Clicked Documents**

Data in the Top Clicked index that is, `idx9998` stored in elasticsearch index can be deleted from Kibana using Dev Tools by sending a clear request to elasticsearch.

  • Go to Kibana and access Dev Tools

1243

  • Give the following POST request to clear all the data from topclicked index `idx9998`


  • If you want to clear the entries in click index please replace `idx9998` with `click`.


  • If you want to delete using date range then give the POST request with date range as shown.



The response would be:

1336