Connect SmartHub to the Azure Cognitive Search Engine

The following topics describe how to add an Azure Cognitive Search engine to your instance of SmartHub.

Note: In the SmartHub user interface the terms "backend" and "search engine" refer to the same thing.

How to Configure the Azure Cognitive Search Engine

Use the follow instructions to configure an Azure Cognitive Search engine

  1. Open a web browser and navigate to your SmartHub Administration page at http(s)://<web-app-url>/_admin
  2. Click General Settings.

  3. Click Add New Search Engine.

  4. Type: Select Regular

  5. Name the search engine and select the Azure from the drop-down list.

  6. Set the following configuration parameters:

    Parameter Required/Optional Description

    Search Service Name

    Required

    Name of an existing search service in Azure to connect to.
    Search Service DNS Suffix Optional
    • This is the DNS suffix of the search service. If left empty, the default value search.windows.net is used.

    API key


    Required



    An API key which has at least read access to the search service.

    Index Name

    This is the name of the index in search service to query.

    Search Fields

    • A comma-delimited list of searchable fields. The query runs only against these fields. Hit-highlighting is automatically enabled for the fields in this list.

    Ratings Sort Field

    This is the name of a column in the search index, which is used to sort documents when the rating is enabled. The default value is escbase_lastupdateutc.

    Minimum Index Coverage

    This is the name of a column in the search index, which is used to indicate the percentage of the index that must be available to service the query before it can be reported as a success. The default value is 100.

    Maximum number of answers A value between 1 and 5 determining the maximum number of answers that should be returned for a query. The default value is 5.
    Minimum number of stop words A value greater than 0, determining the minimum number of stop words necessary for a query to be eligible for semantic search. The default value is 1.
    Minimum number of words A value greater than 0, determining the minimum number of words necessary for a query to be eligible for semantic search. The default value is 3.
    Scoring Profile

    Optional

    This is the name of an existing Scoring Profile created for the used index.

    • For more information about Azure Scoring Profile check here.

    • To learn how to configure a Scoring Profile in Azure, see below.

    Fields with Manual Highlight Optional

    These are the names of the columns in the search index for which the highlight is done manually, without truncating the original value. The properties should be separated by comma. The Default value is escbase_title.

    Allowed source IDs Optional This is a list of GUIDs delimited by commas or semicolons representing the source IDs allowed to perform semantic search.

    Note:

    • When using a field that does not exist in the Azure index as a Filter or as a Sort option, the field will be ignored by the query. 

    • Searching for a field that does not exist or applying a filter that has no corresponding field in the Azure index returns 0 results.  

    How to Boost Results using a Date Property and Scoring Profile

    Procedure:

    1. Go to your Azure Cognitive Search Service
    2. Click Overview → Indexes
    3. Select your index that will be used also in SmartHub
    4. Select Scoring Profiles → Add scoring profile
    5. Enter a scoring profile name and click "Add scoring profile"

    6. Click Add functions → Add Scoring function
    7. From "Function type" dropdown, select Freshness
    8. Choose Field name for boosting
    9. Choose interpolation
      • Required for scoring functions
      • Defines the slope for which the score boosting increases from the start of the range to the end of the range.
    10. Choose a Boost value
      •  Required for scoring functions
      • A positive number used as multiplier for raw score. It cannot be equal to 1.
    11. Choose Boosting duration (Sets an expiration period after which boosting stops for a particular document.)
      1. The Boosting duration must be formatted as an XSD "dayTimeDuration" value.
      2. Example: "P1D" (1 day), "PT15M" (15 minutes)
    12. Click OkSave

Tuning Stages

Two stages are automatically added to both the Query and Results tuning stages for the new Azure search engine (shown in the graphic below):

  • Range Facets
  • Property Mapper
  1. Modify the Property Mapper tuning stage configuration by assigning search index fields to the properties used by default by the SmartHub user interface.

    Important! In the Property Mapper the property "Rank" must be mapped to the property "_score". 

    Example: Rank,_score;

    Note: By default, logs appear in the directory <SmartHub_Install_Directory>\Logging.

 

An alternative way to set up semantic search with Microsoft Azure is to create a query scripting processor and add the following extended properties to the query. This overrides the UI settings and offers more control for the configuration.

Property Accepted values Description
EnableSemanticSearch true/ false Enable or disable semantic search for queries. If turned off none of the options below are taken into consideration.
EnableSemanticAnswers true/ false Enable or disable Smart Answers for queries.
EnableSpellChecker true/ false Enable or disable Spell Checker for queries. If enabled the query text will be automatically corrected before making the search.
SemanticanswersNumber Number between 1 and 5 Maximum number of answers that should be returned for a query. If not set and EnableSemanticSearch is true, the default value is 5.
MinNumberOfStopWords Number above 0 Minimum number of stop words necessary for a query to be eligilbe for semantic search. If not set and EnableSemanticSearch is true, the default value is 1.
MinNumberOfWords Number above 0 Minimum number of words necessary for a query to be eligilbe for semantic search. If not set and EnableSemanticSearch is true, the default value is 3.
AllowedSourceIds GUID A list of GUIDs delimited by commas or semicolons representing the source ids allowed to perform Semantic Search. If not set and EnableSemanticSearch is true, all sources will be allowed.

For example:

Copy
Query.ExtendedProperties.Add("EnableSemanticSearch", true);
Query.ExtendedProperties.Add("EanbleSemanticAnswers", true);
Query.ExtendedProperties.Add("EnableSpellChecker", false);
Query.ExtendedProperties.Add("SemanticAnswersNumber", 5);
Query.ExtendedProperties.Add("MinNumberOfStopWords", 1);
Query.ExtendedProperties.Add("MinNumberOfWords", 3);
Query.ExtendedProperties.Add("AllowedSourceIds", "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA,BBBBBBBB-BBBB-BBBB-BBBB-BBBBBBBBBBBB");

Sample Property Mapper Query Tuning Stage