Query Suggestion Service

There is a fundamental difference between what Google Search Appliance (GSA) provides for auto-suggestions, which is based on user-entered queries, versus SearchBlox, which uses content-based auto-suggestions.

Both approaches have their pros and cons. Unless you enter the query you will not see it suggested in GSA, but in SearchBlox this is created from the content indexed from your pages. This means there will be a lot more suggestions coming from SearchBlox, since there is more text available, rather than the top 1000 queries or so being used for suggestions in GSA.

Autosuggest results from previous search

From 8.6.4 onwards, suggestions from previous queries can be retrieved with AutoSuggest servlet using the collection name searchlogs as shown here
http://localhost:8080/searchblox/servlet/AutoSuggest?q=hello&cname=searchlogs&limit=10,
where the collection name searchlogs represents the collection with previous queries.

Importing or Customizing Search Queries for Suggestion

To import the search queries, use a CSV collection and CSV file for the query suggestion service. (See here for more information: https://developer.searchblox.com/docs/csv-collection). The CSV option is easier to maintain and can be set up for periodic updates. With the query suggestion service, you have complete control over what is suggested for the users.

Then you can call the specific collection for auto-suggestions (http://localhost:8080/searchblox/servlet/AutoSuggest?q=hello&col=1&limit=10). The collection ID will be CSV collection, which contains the search queries from GSA.

Steps for Using CSV Files for Auto-suggestion

Step 1 : Create a CSV file with suggestions

You can either create a CSV file with possible query suggestions, or generate a CSV file based on the past queries from SearchBlox.
Option 1: Create a CSV file with the list of possible words. Enter the column name or field name for the queries as querystring. Here you can have control on what is suggested to the user.

623

Option 2: Generate a CSV file based on the past queries made by users in SearchBlox.

  • Access the following URL to get the queries in CSV format from your Chrome browser.
    [http://localhost:9200/_sql?format=csv&sql=select querystring from querylogs](http://localhost:9200/_sql?format=csv&sql=select querystring from query logs)

Save as CSV file.

642

❗️

Important:

The preceding URL will only work with valid SearchBlox license.

Step 2 - create CSV collection in SearchBlox

Create a CSV collection and enter the file path where the CSV file is stored. The file has to be available in the same server or machine where SearchBlox is running.

Then enter the ID as querystring as in the following screenshot:

910

Please refer to https://developer.searchblox.com/docs/csv-collection for more about working with CSV collections.

Step 3 - Check the autosuggest for the collection created and indexed

After indexing, you can access the autosuggest servlet using the following URL. You must manually stop indexing for CSV collections, since the indexing is continuous by default.

http://localhost:8080/searchblox/servlet/AutoSuggest?q=w&col=1&limit=10

619
SearchBlox ParametersDescriptionGSA Equivalent
qPartial query for which the suggestions are displayed.q
limitThe maximum number of results that the Auto-suggest servlet should return.
Default value is 10.
max
colcollection numbersite
cnamecollection namesite