Use Semantic Analysis to Correct Queries

To be able to provide relevant search results when the user's query is incomplete, misspelled, or imprecise, Exalead CloudView performs a semantic analysis of documents as well as the queries themselves. This generates word matching operators and fuzzy matching options.

For example:

  • Did you mean? Spell check: exalaed will prompt Did you mean: exalead?.

  • Approximation: exalaed will match exalead.

  • Phonetic spelling: exaleed will match exalead.

  • Word truncations: exal* will match Exalead, exalid exalted.

  • Regular expressions: /exa.ead/ will match exalead and exahead.

For more information, see More About Semantic Analysis in the Exalead CloudView Configuration Guide.

Depending on the semantic feature, the analysis takes place either at indexing-time, or at search-time.

  • Index-time: analyzes documents just before indexing, using semantic processors. Anytime you modify semantic processors, you must always reindex your documents before the change will appear in your application.

  • Search-time: analyzes the user's search request, known as query expansion, which essentially adds additional search terms to the user's original query. For example, if phonetic query expansion is enabled, the query exaleed will be expanded to "exaleed" OR "exalead".

    Note: The following tutorial example explains how to configure semantic processing at search time. We will enable approximation for full-text search, to correct user queries with typos. For example, if the user enters croped, the search results will display hits with cropped, the correct spelling, automatically. To enable approximation, we must modify the query expansion configuration for the text: prefix. For details on configuring semantic processing at index-time, see the Exalead CloudView Configuration Guide.

This task shows you how to:

Search Without Approximation

  1. Go to the Mashup UI: http://<HOSTNAME>:<BASEPORT>/mashup-ui .
  2. In the search bar, enter: croped and click Search

Records do not display in the search results as the word is misspelled.

Enable Approximation

  1. In the Administration Console, go to Search > Search Logics > sl0 > Query Expan­sion.
  2. Under Query Expansion Modules, verify that an approximate module appears in the list. If not, add one by clicking Add module.
  3. Go to the Query language tab.
  4. Click the text prefix handler.
    1. Beside Query expansion config, click Edit.
    2. In the Query expansion config window, double-click the approximate module.
    3. Click Accept.

    This creates the following configuration string for this prefix: approximate{}:



  5. Click Apply.

Search with Approximation

In the Mashup UI, search for croped.

This time, records are displayed in the search results, since Exalead CloudView expanded the query with approximation to get the correct orthograph for all fields that have a text semantic type. This is the case for the description and name fields in our example.