Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
QnABot fixup bug May 26, 2017
Search.Azure Initially added May 25, 2017
examples Add initially May 26, 2017
images Initially added May 25, 2017
.gitignore Initially added May 25, 2017
QnASearchBot.sln Initially added May 25, 2017
README.md fixup syntax mistake May 25, 2017


Azure Search QnA Bot

QnA Bot that use Azure Search as the backend for dialogs like answering to your question. This is an demo bot app used during de:code 2017 DI08 session (Azure Search).


The minimum prerequisites to run this sample are:

  • The latest update of Visual Studio 2015. You can download the community version here for free.
  • The Bot Framework Emulator. To install the Bot Framework Emulator, download it from here. Please refer to this documentation article to know more about the Bot Framework Emulator

Bot App Configuration


Add your Bot and azure search service info in Web.config (azure-search-qna-bot\QnABot\Web.config)

    <!-- update these with your BotId, Microsoft App Id and your Microsoft App Password-->
    <add key="BotId" value="YourBotId" />
    <add key="MicrosoftAppId" value="" />
    <add key="MicrosoftAppPassword" value="" />

    <!-- These point to a sample dataset. Update with your own Azure Search service information as needed -->
    <add key="SearchDialogsServiceName" value="YourAzureSearchServiceName" />
    <add key="SearchDialogsServiceKey" value="YourAzureSearchServiceKey" />
    <add key="SearchDialogsIndexName" value="YourAzureSearchIndexName" />
    <add key="SearchScoreProfileName" value="YourAzureSearchScoreProfileName" />

Azure Search

Index Schema (index: qnakb)

    "name": "qnakb",
    "fields": [
        { "name":"id", "type":"Edm.String", "key":true, "retrievable":true, "searchable":false, "filterable":false, "sortable":false, "facetable":false },
        { "name":"question", "type":"Edm.String", "retrievable":true, "searchable":true, "filterable":false, "sortable":false, "facetable":false,"analyzer":"ja.lucene"},
        { "name":"answer", "type":"Edm.String", "retrievable":true, "searchable":true, "filterable":false, "sortable":false, "facetable":false,"analyzer":"ja.lucene"},
        { "name":"category", "type":"Edm.String", "retrievable":true, "searchable":false, "filterable":true, "sortable":true, "facetable":true },
        { "name":"url", "type":"Edm.String", "retrievable":true, "searchable":false, "filterable":false, "sortable":false, "facetable":false },
        { "name":"tags", "type":"Collection(Edm.String)", "retrievable":true, "searchable":false, "filterable":true, "sortable":false, "facetable":false }
     "scoringProfiles": [
            "name": "weightedFields",
            "text": {
                "weights": {
                    "question": 9,
                    "answer": 1
            "name": "personalizedBoost",
            "functions": [
                "type": "tag",
                "boost": 5,
                "fieldName": "tags",
                "tag": { "tagsParameter": "featuredtags" }
     "corsOptions": {
        "allowedOrigins": ["*"],
        "maxAgeInSeconds": 300