XSearch Experiences

Prev Next

The XSearch Experiences page is where you can configure actual implementations of XGen's search API that will be integrated onto your site.

All Experiences Page

This is where you can view all of the experiences that have been created. Clicking on an experience will allow you to edit that deployment. Clicking the trash icon will permanently delete that experience. Once an experience has been deleted, it is gone forever and cannot be recovered.

Clicking “New Experience“ in the top right will bring up a popup allowing you to select options for a new experience. Input an experience name and then pick the experience version you want.

  1. XGen Rendered- utilizes XGen's render API to integrate the experience onto the site with the settings you configure in the portal. Any changes to the portal will show up in real time with the experience on the site.

  2. API Version- a stripped back version of an experience that only requires the basic settings to get an experience up and running and will allow you to call XGen's search API through our SDK to get search results. You are responsible for calling and rendering the API version of experiences.

All of the following settings are configurable within the “XGen Rendered” experiences, but not all settings are available in the “API Version” experiences. This is because the API version does not require as many settings since these will be configured on your end via code.

Updating

The button in the top right of the element has to be clicked in order to save any changes that have been made to the experience. If there are any changes that are not saved, there will be a little subtext under the button saying “Save Changes.”

If you update an experience that is currently published, the changes will be live on the site immediately, so make sure you don't update anything you don't mean to.

Publishing

In the top right corner, there is a button that will either say “Unpublished” or “Published” and clicking this button will toggle that state. If an element is published, that means the element is live on the site for users to see (assuming that the triggers and hook are set properly).

Once you toggle the published state, you will still have to click the “Update” button to apply.

Triggers

Triggers allow you to configure when an experience will be rendered on the site. If the URL of a page matches the configured triggers, than the experience will render on that page. If the URL does not match the triggers, the element will not render. All triggers for an experience have to match the URL in order of the element to render, but you can create as many or as few triggers as you need.

When you have a new trigger, first select the part of the URL that you want to target (Page Path or Query String) then select the operator you want to use from the dropdown on the right of the trigger. Finally input the value that you want to test the URL against.

Some site URLs contain a very generic path that makes it differentiate one page from another. If this is the case, you can use Contextual Page Triggers in the XGen SDK to allow you to set triggers based on code rather than the URL.

Element Hook and Position

The hook is the place within the page that the experience will be placed when the triggers match. The input box is a CSS Selector that points to the specific element in the DOM that you would like to target. It will grab the first element in the DOM that matches the selector you input. Then select if you want the experience to render Above, Below, or Replace the targeted element with the selector.

Example:

If you set the hook to .searchSection and REPLACE, then the experience will target the first element that has the class name searchSection and will replace its contents with the markup for this experience.

Filter Rule

(Optional) You are able to select a filter that will take the search results and filter them down based on the rules you set. For example, the most common use case is excluding products that are out of stock. You can select an existing filter with this rule, or click on “Create new Filter” and go to the Filters configurator to create a new filter that excludes out of stock products. Now when the user searches using this experience, they will no longer see products that are out of stock.

Alternatively, filters can be combined with contextual variables to create on-site filters. For example, if the clicks “green” on the site, then they will only get green products.

Type-to-Search Settings

Type-to-search refers to the functionality of a user getting search results while they are still typing out their query. Our elements allow multiple options to configure these settings. Note: these settings are only used to control the getTypeToSearch function within the elements.

If that function is not utilized properly within the elements's JavaScript, type to search will not work.

General Settings

NAME/TYPE

DESCRIPTION

No Type to Search

boolean

When this setting is enabled, there will be no search results as the user is typing.

Enable Type to Search

boolean

  • This will enable the type to search functionality within experiences.

  • This setting will also utilize XGen's type-to-search API which uses a faster version of DeepSearch.

  • You can select a trigger to define exactly when this functionality kicks in. See triggers section below.

Switch to Primary Search

boolean

  • Instead of using the type-to-search API above, type-to-search can be configured to use XGen's primary search API instead.

  • You can utilize triggers to define when primary search will kick in, or you can configure it to always use primary search. See triggers section below.

Debounce Time

number

  • The debounce time is the amount of time required in between user actions in order for the search API to be called.

  • For example, lets say the debounce is set to 150ms. When the user types a character, a 150ms timer will start. When that timer ends, the search API is called; however, if the user inputs another character before that 150ms timer is up, the timer will reset and wait another 150ms.

  • Debounce is a way to optimize the API so that no unnecessary requests are sent thus decreasing the load on the network and the API which will result in a faster experience for the user.

Type-to-Search Triggers

Triggers are used to define when a specific piece of type-to-search kicks in based on the user's input.

Any numerical values are "greater than or equal to".

NAME/TYPE

DESCRIPTION

No Trigger

boolean

The setting will be activated as soon as the user starts typing.

Character Count

number

The setting will be activated as soon as the user types a query with that many characters.

Word Count

number

The setting will be activated once the user types a query with that many words.

Note: a word is counted by groups of characters separated by white space. “red p” and “red pants” are both considered two words, but “red “ with a space at the end is only considered one word.

Key Input

boolean

The setting will be activated once the user types one of the designated keys while the search input is selected.

Preview

Preview links are a way to allow you to view experiences on your site the exact same way as they will be when they are published without anyone else seeing the experiences. Start by clicking “Create new preview link” then paste in the URL of the page you want to preview the experience on. Once done, you can click on the link icon and view the experience on that page an interact it with as much as you want without actually publishing the element.

Templates

The experience template modifies the code that will go onto the site once the experience is published.