Kentico Xperience 13 documentation and ASP.NET Core

Most documentation about running Xperience applications under ASP.NET Core can be found in a dedicated section: Developing Xperience applications using ASP.NET Core. The rest of the documentation still applies, but some code samples and scenarios might need slight modifications for Core projects.

All major differences between the MVC 5 and Core platforms are summarized in Migrating to ASP.NET Core.

×

Mapping fields for search results

When setting up search using locally stored indexes, you can separately configure the indexed objects (Page types, Custom tables, Forms, etc.), and choose which data appears in search results.

The appearance and design of the results always depends on the search interface implementation. However, the system allows you to map specific object fields to the most common parts of search results, such as the title, content extract or image. Developers can then access the mapped data in their code using the corresponding properties of SearchResultItem objects, which they process within the search implementation.

  1. Edit the indexed object (most commonly in the Page types, Custom tables or Forms application).
  2. Select the Search tab.
  3. In the Field mapping for search results section, choose source fields for the following parts of search results:


    DescriptionSearchResultItem property
    Title fieldThe field whose value is used for the title of search results.Title
    Content fieldThe field whose value is used for the content extract of search results.Content
    Image fieldThe field that contains the image displayed in search results.Image
    Date fieldThe field whose value is used for the date and time displayed in search results.Created
  4. Click Save.

The search results for the given object type now display data from the assigned fields, provided that developers use the corresponding SearchResultItem properties within the search implementation.

All selected fields are automatically included within search indexes that cover the object type. This applies even for Pages indexes and page types using the HTML output data source (in this case the search itself is based on the processed HTML content of pages, but data for search results is loaded from the assigned fields).

Note: Search result field mapping does not have any effect for Azure Search indexes. The format of Azure search results is fully controlled by the implementation of your search interface. See Integrating Azure Search.


Was this page helpful?