# Keyword


# Description

The <Keyword> tag defines rules for how search results will be generated when the user enters keywords to search for. Within the tag, you can specify indexes that you would like the user to be able to search for using words they have entered.

Any keyword rule you wish to add to your 1search implementation must be specified within a <Keywords> tag.

# Syntax

<Keywords>
    <Keyword Name="string" Func="string" ValueComparer="string">
        <SupportingIndexes>
            <Include>
                <Index Type="string" Name="string"/>
                <Index Type="string" Name="string"/>
            </Include>
        </SupportingIndexes>
    </Keyword>
</Keywords>

# Attributes

Note: attributes marked with * are required.

Attributes within the <Keyword> tag include:

  • Name* (string) :
    • The name of your Keyword rule. This value must be unique across all other keyword tags defined.
  • Func (string) :
    • The function used to determine how the keywords entered by the user will be processed as strings. If used, this value must match the name of the function you wish to use as defined in <Functions>.
  • Key (string) Replaces Func:
    • You may choose to use key to specify a JSON path in place of a function if the data you are providing is suitable.
  • ValueComparer (see String Comparer) :
    • Defines how the keyword string entered by the user will be compared to facet string in your search engine.

Attributes within the <Index> tag include:

  • Type* ("Aspect", "Range", "POI", etc) :
    • Defines the type of index you are referring to.
  • Name* (string) :
    • This value must be identical to the name of the index you wish to include in <Keyword>.

The attributes defined within the <index> tag are used as identifiers for what item attributes should be looked in and compared with the keyword string in order to find the proper result you are looking for. For example, if you have Genre within the index tag, when you use a keyword query to search for "melon", the system will search for melon in all the Genre aspect values.

Only full words will be compared though, if you enter a single letter expecting it to find all items that contain that letter, it will not return anything.