Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
excludeRelated Articles

Prerequisites

  • “Content type” or “Taxonomy type”, where the search is to be executed, to be known.

  • Trained Content and Utterances, to trigger the intent.Index the documents by going to the Schema and from the hamburger menu click “Index Documents”

Getting started with Experience Designer

  1. Login to Experience Manager.

  2. From the Recent Projects section, Click on your project.

  3. Click on the briefcase icon on the side menu bar.

  4. Click on ‘Experience Designer’ in the same side menu bar under the ‘DEVELOP’ section.

  5. The Experience Designer will open in a new tab. Search for any node in the top left corner of the page.

    Image RemovedImage Added

Search Node

  1. In the left side menu, we can use the search box to search for the required node.

  2. Navigate or search for “Search Node”.

  3. To use the search node, drag and drop the ‘Search’ node in the workspace.

  4. Double click on the ‘Search’ node in the workspace. Two sidebars, named ‘Edit Search Node’ and “info”, will pop up to the right end of the screen. In this “Edit Search Node”, we can select the “Type” and can write a search query in this window.

  5. In the ‘Edit Search Node’, we can find a mandatory field ‘Type’. We can set this parameter to any of Content collection or Taxonomy, where the search query executes.

  6. In the ‘Edit Search Node’, we can write a custom query in the query editor (shown in the below screenshot).

    Note: Search for dynamic data using mustache tags is detailed in the below sections.

  7. The result will be in the JSON document format.

...

We used mustache tags in the search node to get search results.The current implementation requires a function node to be used as an input for the search node in order to use the mustache tags in the search nodecreate the query.

Sample flow:

The output from the function node, which takes dynamic input, will be the input for the search node.

...

Search for content by type

For searching content using the ‘Search’ node, we must use the drop-down list to select the type in the ‘Edit Search node’ pane.

In the below screenshot we can see two categories and their corresponding types.

The type selects the content collection to be searched or a Taxononmy.

Content

...

Taxonomy

...

Then use the sample query code to search for the content needed.

In the code, the field name depends on the selected type.

Each type will have different fields in them. Therefore, we have to change the query code every time the type is changed.

The query object defines how we will search the collection.

The fields you are searching for depends on the schema.

Sample Code:

Code Block
{                          

  "q": {

    "query": {

      "bool": {

        "must": {

          "match": {

            "text": "<Sample text>"

          }

        }

      }

    }

  }

}

...

Code Block
{

  "q": {

    "query": {

      "bool": {

        "must": [

          {

            "match": {

              "tag": "Health Tips"

            }

          },

          {

            "match": {

              "text": "Lose weight"

            }

          }

        ]

      }

    }

  }

}

Geo Search

You can use the below query for searching content using ‘Search’ by GeoSearch.

Code Block
{

  "q": {"query":{"bool":{"must":[{"match_phrase":{"providertype.value":"specialist"}},{"match_phrase":{"specialitylist.value":"Cardiology"}}],"filter":[{"geo_distance":{"distance":"3000miles","location":{"lat":42.3517272,"lon":-71.0408624}}}]}},"sort":[{"_geo_distance":{"location":{"lat":42.3517272,"lon":-71.0408624},"order":"asc","unit":"miles"}}]}

}

Related Articles

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel = "essential"