Search for Editors

Search for editors is a quick and comparatively user friendly way of configuring a product search on a solution.

The process is straight forward:

  • You define a context – the languages and shops you want to create a search configuration for
  • You select a set of fields you want to include in the search in some way
  • You define how to use each field – whether to include it in free text search, create a facet from it, how important it is, etc.
  • You specify how to sort the results

When the configuration is saved, the system generates an index, a query, and a set of facets from the configuration parameters. The configuration can then be used in the product catalog app to publish the products included in the configuration.

To create a Search for editors-configuration:

  • Go to Settings > Repositories > Search for editors
  • Click New configuration in the toolbar to open the configuration view (Figure 2.1)
  • Enter a name
Figure 2.1 The configuration view
  • If this is the first time you are creating a Search for Editors configuration, you will be asked to create a new index for Search for Editors.
    • Click Create Index in the toolbar
    • Select a Repository to place the index in - by default, the system will suggest a SearchForEditors repository
    • Name the index, e.g. Search for Editors
    • Click Create

All subsequent Search for Editors configurations will use this index index, so these steps need only be following this one time.

Next, you must define the context (Figure 3.1)– that is, which products you want to publish in frontend when the configuration is used.

Figure 3.1 The Context section defines which products to publish

In the Context-section you can:

  • Specify which ecommerce languages to include:
    • All languages
    • Current language
    • Selected language(s)
  • Specify which shops to include:
    • All shops
    • Current shop
    • Selected shop(s)
  • If needed, Exclude products which:
    • Are inactive
    • Have no price (when live integration don't check this box)
    • Have no stock
  • Specify how you want to show variants in frontend:
    • Only the master products
    • All variants separately
    • Only the primary variant

After configuring the context settings click Save – most of the settings will take effect immediately, but some (like the Exclude products settings) require an index rebuild. When this is required you are notified – click the Rebuild indexes button to rebuild your indexes (Figure 3.2).

Figure 3.2 Rebuilding indexes

Where the Context section selected which products to publish, the Fields section determines how visitors can search and filter those products. It lists the product fields on a solution, both standard fields and custom fields, alongside a number of settings for configuring the search (Figure 4.1).

Figure 4.1 The Fields section

Before we proceed let’s cover some basic terminology related to searching:

  • A facet is a kind of filter – it is usually shown next to the product list as checkboxes, a color selector, or perhaps a price range slider.
  • A query search is a search where you can search by adding a particular parameter name and value to the query string – e.g. ProductNumber=1.
  • Free text search is when a visitor can type something into a search field and see which products match the search term.
  • Boost is when a field is given more importance than other field when search results are ranked.
  • A constant is a value that cannot be altered

When you create a Search for Editors configuration you generally want to create a free text search and a set of facets appropriate to the product portfolio – color, size & brand for apparel, or frame material, brand, and drivetrain for bicycle frames, etc.

To add a field to the free text search:

  • Check the Free text search checkbox
  • (Optional) assign a boost value to the most important fields
  • Save

To create a facet from a field:

  • Use the Facet-dropdown to select a type of facet – checkboxes, radio buttons, etc.
  • (Optional) change the Url name value to something frontend appropriate, if necessary
  • Save

Some configuration choices prevent the field from being used elsewhere – in those cases the unavailable fields are greyed out. For instance, facets require the query search checkbox to be checked, and faceted field cannot have a boost value or a constant set.

Whenever you make a change to the fields section, you will be asked to rebuild the index. This is done by clicking the Rebuild indexes button in the toolbar ({figureref]).

Figure 4.2 Rebuilding indexes

Below the fields section, the sort section (Figure 5.1) controls the order in which the search results are published in frontend. By default results are sorted by score, which is a calculated value of how well the product matches the search term.

Figure 5.1 The Sort section

You can replace the default sorting by removing the Score row from the section and adding a different sort order:

  • Press Click here to add a new row
  • Select a field to sort by
  • Select a direction
  • Click OK
  • Save

You must add an alternative sort order, or Score will be used anyway (as per Lucene).

Search for Editors configurations are used to publish products in frontend – see more in the Product Catalog app article.

Please keep in mind that:

  • Your current product list template may not work out of the box with a Search for Editors configuration – please check thoroughly before reporting an issue
  • The free text search query parameter is ‘q’ or ‘Search’ – both ?q=[search term] and ?Search=[search term] may be used

Like other indexes, the indexes generated by Search for Editors have to be rebuilt periodically. To handle that, we auto-generate a task which runs once a day - but you're not limited to using the auto-generated task.

You can also:

  • Create a scheduled task using the Build repository index add-in
  • Selecting the SearchForEditors index to be auto-built when products are changed on a shop in Ecommerce or warehouse in PIM

If you eventually outgrow the limitations of the Search for Editors configuration, you can export the generated query and facets and work with them as “normal” queries and facets under the repository you associated with Search for Editors.

To do so:

  • Click the Export button in the toolbar
  • Select an index associated with the configuration
  • Enter a query name and a facet name
  • Click Create

The query and facet configuration is then exported to the selected repository (Figure 7.1), and can be modified and used like any other index query and facet – read more about indexing and search here.

Figure 7.1 Exporting a Search for Editors configuration