SearchBlox

SearchBlox Developer Documentation

Welcome to the SearchBlox developer documentation. Here you will find comprehensive technical documentation to help you start working with SearchBlox as quickly as possible, as well as support if you get stuck. Let's jump right in!

Guides

AutoSuggest

SearchBlox SearchAI SmartSuggest

SearchAI SmartSuggest is built to provide suggestions for search queries because it understands the context and how they’re related to the actual content on your website. This is achieved using several cutting edge machine learning algorithms that comb through all the data on your website, determine the most relevant ones, prepare suggestions, rank them and then work in real-time to determine which suggestion should be provided when the user starts typing.
https://www.searchblox.com/search-ai-smartsuggest.html
To signup for a FREE SearchAI SmartSuggest Service subscription click thefollowing link:
https://searchai.searchblox.com/smartsuggest/signup

SearchBlox Indexed Data Based Autosuggest

  • Autosuggestions can be fetched from content or title field of indexed data
  • Content-Based Autosuggest fetches suggestions from the content indexed. If the user wants to enable this in the search, then the selection has to be made in Search Settings as shown:
  • Title-Based Autosuggest fetches suggestions from the title field indexed. If the user wants to enable this in the search, then the selection has to be made in Search Settings as shown:

🚧

Important Information

  • Kindly note that it is mandatory to select the Autocomplete field in search settings for the suggestions to be fetched from title or content in AutoSuggest Servlet mentioned in the preceding section.

Parameter

Description

q

Query

col

Collection Number
Absence of the collection field will fetch suggestions from all collections

cname

Collection Name
Absence of the collection field will fetch suggestions from all collections

limit

Number of suggestions per page

SearchBlox Query-Based Autosuggest

  • Autosuggestions can be fetched from past queries made by the user.
  • Query-Based Autosuggest fetches suggestions from the past queries logged in the querylogs index. If the user wants to enable this in the search, then the selection has to be made in Search Settings as shown:

🚧

Important Information

It is not mandatory to select the autosuggest field as the query in search settings as providing the cname as searchlogs will fetch suggestions from querylogs irrespective of the selection made in search settings Autocomplete field.

q

query

cname

The cname value has to be searchlogs for fetching suggestions from querylogs

limit

Number of suggestions per page

AutoSuggest in Faceted Search

  • Autosuggest/Autocomplete is enabled by default in faceted search.
  • This feature can be disabled by making the change in <SEARCHBLOX_INSTALLATION_PATH>/webapps/searchblox/plugin/facet.js by providing false as value for the field showAutoSuggest as shown:
    "showAutoSuggest": false,
  • The number of autosuggest values in default faceted search would be 5.
  • The source of suggestions can be selected in Search Settings as mentioned in the previous sections.

AutoSuggest Servlet Parameters

SearchBlox Parameters

Description

GSA Equivalent

q

Partial query for which the suggestions are displayed

q

limit

The maximum number of results that the Auto-suggest servlet should return.
Default value is 10.

max

col

collection number

site

cname

collection name

site

Custom Autosuggest

  • In SearchBlox it is possible to configure AutoSuggest for specific fields other than content or title or querylogs.
  • These specific fields could be SearchBlox fields or custom fields indexed in SearchBlox.

Custom Autosuggest for Custom Fields

Autosuggest or autocompletion can be enabled for a custom field using the following steps:

  1. Go to <SEARCHBLOX_INSTALLATION_PATH>/searchblox/webapps/searchblox/WEB-INF/
  2. Make changes in mapping.json or jdbc.json or csv.json depending on the collection from which the field is used for AutoSuggest. To learn more on mapping and collections associated read: Mapping Files for Collections
  3. Give the following mapping in the custom field:
"author": {
        "type": "completion"
      },
  1. Clear and reindex the collection with the field.
  2. Select Autocomplete Field as Title or Content.
  3. Check the autosuggestions with following URL and params in AutoSuggest Servlet
    http://localhost:8080/searchblox/servlet/AutoSuggest?q=speaker&type=custom&field=author

Custom Autosuggest for SearchBlox Fields

Custom Autosuggest can be used for SearchBlox fields as in the following steps:
Let us consider that autosuggest is to be used for the description field, it can be done in two ways:
Providing Subfield within the Actual Field

  1. Go to <SEARCHBLOX_INSTALLATION_PATH>/searchblox/webapps/searchblox/WEB-INF/
  2. Make changes in mapping.json or jdbc.json or csv.json depending on the collection from which the field is used for AutoSuggest. To learn more on mapping and collections associated read: Mapping Files for Collections
  3. Give the following mapping in the description field:
"description": {
         "type": "text",
        "store": true,
        "analyzer": "sb_analyzer"
        "fields": {
          "desc": {
            "type": "completion"
          }
        }
      },
  1. Clear and reindex the collection.
  2. Select Autocomplete Field as Title or Content.
  3. Autosuggestions can be fetched based on description field using description.desc as in the following URL
    http://localhost:8080/searchblox/servlet/AutoSuggest?q=y&type=custom&field=description.desc

Copying to a New Field

  1. Go to <SEARCHBLOX_INSTALLATION_PATH>/searchblox/webapps/searchblox/WEB-INF/
  2. Make changes in mapping.json or jdbc.json or csv.json depending on the collection from which the field is used for AutoSuggest. To learn more on mapping and collections associated read: Mapping Files for Collections
  3. Give the following mapping in the description field and test field:
"description": {
         "type": "text",
        "store": true,
        "analyzer": "sb_analyzer"
        "copy_to": "test"
              },
        "test": {
            "type": "completion"
            },
  1. Clear and reindex the collection.
  2. Select Autocomplete Field as Title or Content.
  3. Autosuggestions can be fetched based on the description field using field test as in the following URL
    http://localhost:8080/searchblox/servlet/AutoSuggest?q=y&type=custom&field=test

Updated about a month ago



AutoSuggest


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.