Implementer training - best bets

Best bets allows an administrator to configure a featured result item to be displayed when a user conducts a specific search.

A best bet is not a search result, but it can feature or promote a page / URL that is not part of a website that is being indexed.

For example, when a user searches for the term Foodista a best bet to featuring the Wikipedia page on Foodista wiki is displayed above the search results. This is presented in addition to the search results.

best bets 01

The style and appearance of the best bets in the search results is governed by the stylesheets that are applied to the search results template, and the position in the search results can be controlled by a search administrator with the ability to edit the templates. A best bet can include HTML formatting.

In the example above a HTML snippet including an image of the Foodista logo has been returned with the best bet.

Managing best bets

Best bets are managed from the best bets section of the insights dashboard. The best bets screen provides tools for creation, editing, cloning and deletion of best bets, and also the ability to publish and unpublish.

Initial view

If your results page does not have any best bets defined the following screen is displayed when accessing the best bets screen:

managing best bets 01

Manage view

If your results page has existing best bets defined, a table listing the configured best bets is displayed. Clicking on a best bet opens the best bet inside the editor. Administrators also have the ability to publish, un-publish, clone and delete a best bet:

managing best bets 02

Cloning an item makes a copy of an existing best bet that can then be edited.

Best bets are not available in the live search until they are published. This allows a best bet to be created and tested before release, or staged for later use.

Clicking the add new button opens the best bet editor.

To remove a best bet it must first be set to an unpublished status by clicking the un-publish button. Once unpublished the best bet can be deleted by clicking on the delete icon.

All best bets can be removed by selecting the tools  clear all menu item.

Creating and editing best bets

Best bets are created, edited and published using a simple edit screen on the administration and insights dashboards.

Best bets edit screen

The example below shows the configuration for a simple best bet.

creating and editing best bets 01

Each best bet requires the following:

Title

used for the hyperlinked text for the best bet result

Description

used for the summary text presented below the title. This can include HTML formatting.

URL

this is the URL to link to when the best bet is clicked on. The URL can be any URL and does not need to be part of the search. There is an option that allows the URL to be removed from the set of search results if it matches the URL for the best bet.

Trigger

these are the search terms that will cause the best bet to be displayed.

Trigger type

this controls how Funnelback compares the user’s query to the best bet trigger. There are four types of triggers:

  • The search keyword(s) exactly matches: This will only trigger if the user’s keyword is identical to the trigger.

  • All words must be present in the search keyword(s), in any order: This is the most commonly used trigger and matches when all the trigger terms appear within the user’s query. E.g. the best bet using a trigger of "red wine" will appear as long as the words "red" and "wine" both appear somewhere in the user’s query.

  • Substring match: The best bet is returned if the trigger is a substring of the user’s query. E.g. a best bet with a trigger of "red" will be returned for the following queries: red wine, reduction, blackened redfish.

  • Regular expression match: (advanced) The best bet is returned if the trigger regular expression matches the user’s query. This is an advanced match type for power users allowing advanced matching such as wildcards. If you are unfamiliar with regular expressions then don’t use this trigger type. The trigger is expressed as a Perl5 regular expression.

A bulk import/export option is also provided, allowing you to edit all of your best bets inside a CSV file.

Previewing and publishing a best bet

Funnelback provides the ability to preview changes made to best bets and other configuration allowing changes to be made and viewed without the live search being affected.

The changes are then published to make them visible on the live search.

Best bets once live can also be unpublished - this removes them from the live search and allows them to be previewed and edited for future use.

When an item is saved but marked as unpublished it can be viewed by selecting preview from the menu attached to the search box located at the top of the insights dashboard.

menu bar live preview

This will run a search using the live index, but apply anything that is marked as unpublished. This allows a best bet to be created and tested before it is released.

Selecting live from the search box menu will run the search against the live index applying only configuration that has been published and is equivalent to what public users of the search will see.

Complete the following exercise if you’re completing the SEARCH 101 training course:

Tutorial: Creating a best bet
  1. Log in to the insights dashboard and select the Foodista results page.

  2. Observe the summary tile for best bets. The summary is showing that there is 1 best bet configured - and there are no best bets that contain unpublished changes.

    exercise best bets md 01
  3. Click on the best bets tile, or select best bets from the left hand menu to open the best bets section.

    exercise best bets md 02
  4. Click the add new button to open the best bets editor. Observe that the preview is updated dynamically as data is entered into the form. Enter the following into the best bets editor then click the add button:

    • Trigger keywords: blood orange

    • Match type: The search keyword(s) exactly matches

    • Title: Blood orange rosemary sorbet

    • URL to display/link to: http://www.foodista.com/recipe/QGFGMQN6/blood-orange-rosemary-sorbet

    • Description: This is a simple, beautiful and delicious treat to beat the mid-winter funk. Mix with champagne or prosecco for a beautiful and simple dessert perfect for entertaining!

    exercise best bets md 03
  5. Observe that the new best bet now appears in the list of best bets, and that it has a status of new and that there is a button available to publish the best bet.

    exercise best bets md 04
  6. Run a search for blood orange using the search box at the top of the insights dashboard. Ensure that preview is selected from the drop down.

    exercise best bets md 05
    exercise best bets md 06
  7. Observe the best bet appearing above the search results. Return to the insights dashboard and run the query again, this time ensuring that live is selected from the drop down.

    exercise best bets md 07
    exercise best bets md 08
  8. Observe that the same results are returned, but the best bet is not displayed. This is because the best bet has not yet been published. Return to the best bets editor and publish the best bet, then rerun the query ensuring that live is selected from the drop down menu. Observe that the best bet is now returned with the results.

    exercise best bets md 09
  9. Run a search for blood orange juice. Observe that the best bet is not returned. This is because the trigger for the best bet has been set to the search keyword(s) exactly matches - this means that the best bet will only trigger if the user’s query exactly matches blood orange. Return to the best bets editor and change the trigger to substring match. Save and publish the best bet and rerun the search for blood orange juice. Observe that the best bet is returned. This is because the trigger blood orange is a substring of the user’s query, blood orange juice.

  10. Return to the best bets editor and change the trigger to foodista orange and the trigger type to all words must be present in the search keyword(s), in any order. Run a search for orange foodista and observe that both best bets are now returned. This is because the trigger conditions for both of the best bets are met. A search for orange cake foodista will also trigger both best bets. This highlights that the order of the trigger terms does not matter when using the all words are present trigger.

    exercise best bets md 10

Complete the following exercise if you’re completing the SEARCH 201 training course:

Tutorial: Creating a best bet

In this exercise you will create a simple best bet and see how it is returned in the search results.

  1. Log in to the search dashboard and open the results page manage screen for the inventors results page, linked to the female inventors search package.

  2. Select customize best bets from the customize panel.

    manage results page panel customize
  3. The insights dashboard will open on the best bets screen.

    exercise creating a best bet 02
  4. You can also access the best bets editor from within the insights dashboard by either selecting it from the left-hand menu of the dashboard or via the default dashboard screen of your service.

    exercise creating a best bet 03
  5. Click the add new button to open the best bets editor. Observe that the preview is updated dynamically as data is entered into the form. Enter the following into the best bets:

    • Trigger keywords: toys

    • Match type: The search keyword(s) exactly matches

    • Title: Barbie dolls - Ruth Handler

    • URL to display/link to: https://docs.squiz.net/training-resources/inventors/Ruth-Handler.html

    • Description: Perhaps one of the most famous toys in American history, the Barbie doll is a staple in the toy chests of little girls everywhere. Along with co-founding the renowned toy company Mattel, woman inventor Ruth Handler also designed the doll that would become an American cultural icon.

    exercise creating a best bet 04
  6. Click the add button (not add and publish) to create the best bet.

  7. Observe that the best bet now appears in the list of best bets, and that it has a status of new. There is also a button available to publish the best bet (don’t click this yet).

    exercise creating a best bet 08
  8. Run a search for toys using the search box at the top of the insights dashboard. Ensure that preview is selected from the drop-down menu.

    exercise creating a best bet 06
  9. Observe the best bet appearing above the search results.

    exercise creating a best bet 07
  10. Return to the insights dashboard and run the query again, this time ensuring that live is selected from the drop-down menu. Observe that the same results are returned, but the best bet is not displayed. This is because the best bet has not yet been published.

    exercise creating a best bet 10
  11. Return to the best bets editor and publish the best bet, observing that the status now changes to published, and that the unpublish button is now clickable. Clicking unpublish will return the best bet to the new / unpublished state.

    exercise creating a best bet 05
  12. Re-run the query ensuring that live is selected from the drop-down menu. Observe that the best bet is now returned with the results. Clicking add and publish on the best bet creation / editor screen has the same effect as clicking the publish button on the listing screen.

  13. Run a search for girls toys. Observe that the best bet is not returned. This is because the trigger for the best bet has been set to the search keyword(s) exactly matches - this means that the best bet will only trigger if the user’s query exactly matches toys. Return to the best bets editor and change the trigger to substring match. Save and publish the best bet and rerun the search for girls toys. Observe that the best bet is returned. This is because the trigger toys is a substring of (or contained within) the user’s query, girls toys.

    exercise creating a best bet 11
Extended exercises: best bets
  1. Experiment creating some additional best bets with different trigger types and ensure that the trigger matching makes sense.

  2. Add some HTML formatting to a best bet so that the thumbnail image of the inventor is displayed beside the best bet. Hint: you may need to use the <#noescape> Freemarker function.