Create and Configure Indexed Types

Learn how to create and configure Indexed Type by defining its properties and queries.

Each item in Solr has a certain type. There is a specific number of types coming with the solrfacetsearch extension. However, you can also add new Solr item type. By adding the new types, you can define your own set of items that can be searched by the SolrFacetSearch service.

The Backoffice Administration Cockpit provides you with a wizard that helps you to easily create and configure each item.

Add Solr Indexed Types

Procedure

  1. Navigate to Start of the navigation pathSystem Next navigation step Search and Navigation Next navigation step Solr Facet Search Configuration Next navigation step Indexed TypesEnd of the navigation path. On the right, you can see the list of available item types (if there are any defined).
  2. Click the button at the top of the editor.

    A pop-up window appears.

  3. In the Type section, you need to choose the types to be indexed. Provide a unique Identifier and select a Composed Type for your item.

    To define the properties at this point click Next.

Defining Properties for Indexed Types

You can codify your indexed types using properties.

Context

You have already created an indexed type and you want to define it further by adding additional settings.

Procedure

  1. Navigate to Start of the navigation pathSystem Next navigation step Search and Navigation Next navigation step Solr Facet Search Configuration Next navigation step Indexed TypesEnd of the navigation path. Select the configuration that you have created the indexed type for.
  2. Select the Indexed Properties tab and click Create new Property.
  3. In the Essentials section, define the following settings:

    Field Name

    Description

    Name

    A unique name of the property.

    Type

    Determines the custom type of the property.

    Facet

    Determines if the property should be classified as a facet.

    Multi-value

    Determines if the property can hold multiple values.

    Currency

    Determines if the property can hold currency.

    Localized

    Determines if the property can be localized.

    Use for spell-checking

    Determines if the property should be subject to spell-checking.

    Use for auto-complete

    Determines if the property should be subject to auto-complete.

    Include in Response

    Determines if the field is returned within a query response.

    Use for highlighting

    Determines if the field is used to highlight search terms from search results.

  4. Click Next to proceed.
  5. In the Other section, specify any additional values for your property.
  6. Click Done.

Results

A new property is added to the list.

Define Queries for an Indexed Type

Context

The Indexer Configuration section of the Indexed Types tab provides you with a wizard to create the indexer queries.

Procedure

  1. Navigate to Start of the navigation pathSystem Next navigation step Search and Navigation Next navigation step Solr Facet Search Configuration Next navigation step Indexed TypesEnd of the navigation path. Select the configuration you want to create a search query for and click it to access the editor.
  2. Click the Create new Indexer Query button at the bottom of the section to create a new indexer query.

    A new window pops up.

  3. In the Essentials section, provide the values for the mandatory fields.

    Field Name

    Description

    Identifier

    A unique name of the query.

    Type

    The type of your query. You have the following values to choose from:

    • FULL: recreates the index

    • UPDATE: updates some documents in the index

    • PARTIAL_UPDATE: allows you to select the fields for the update

    • DELETE: deletes documents from the index

    Query value

    A flexible search query.

    Inject current date

    Checks if currentDate parameter should be injected to the query.

    Inject current time

    Checks if currentTime parameter should be injected to the query.

    Inject last index time

    Checks if lastIndexTime parameter should be injected to the query.

  4. Proceed to Others section. Select the users, if queries are executed with the user's privileges. Click Done to finish.
  5. You can now define the additional settings for the Indexed Type, using the main editor.

Additional Settings for Indexed Types

Search Query Templates

The search query templates introduce numerous customization options for getting improved search results for the customers. When creating the templates you can use various attributes, such as page size, grouping or sorting with respect to various channels, or even storefront parts. For details on creating and managing search query templates see Search Query Templates.

Others

For each of your indexed types, you can also define the additional settings - you’ll find under in the Indexed Types tab in the section Others. You can define the following items:
  • Identity provider: Identity provider for the item type

  • Model loader

  • Model fields values provider: Sets fields values provider that depends on this type rather than on particular properties.

  • Default property value provider

  • Result converter: Result converter (spring bean id) needed to convert Solr result data into a simple data object that could be used to display indexed type (i.e. product) data directly on the front end

Advanced Configuration

In the Advanced Configuration section you can define additional parameters for an indexed type, such a shard configuration. The number of shards and replication factor can be configured per facetsearchconfig, in which case all the Indexed Types related to it will use the same configuration. For details on configuring the facetsearchconfig item see: Define Search and Indexer Configuration.

However, it is possible to override the configuration for an individual Indexed Type using the Advanced Configuration section.