Adding indexes

By default, the AutoComplete service indexes each property for which AutoComplete is configured. If you want to index additional properties, you can add an INDEXES node as a child of a COMPONENT node. The INDEXES node is a parent to one or more INDEX nodes. Each INDEX node has a bind attribute that specifies a property that you want to index.

Note: If you add an INDEXES node, you should include an index for the property specified in the COMPONENT node. Ordinarily this property is indexed automatically, but adding an INDEXES node overrides this behavior.

Adding indexes serves several purposes. First, any properties that you use in custom displays or custom queries should be indexed. Similarly, if a component has an EXPIREDFILTER, you should index the effective date and expire date.

You can also use indexes to fill in fields in addition to the one for which AutoComplete is configured. For example, the Address.StreetName field has indexes for the street number, city, state, and so on, so that you can fill in an entire address from the AutoComplete results.

If you’re using an index to fill in an additional field, you must also add a behavior attribute and set it to None or Multiple. By default the indexes are only used in the AutoComplete search, not to populate additional fields. None indicates that the index isn’t used in the search, so it will be used to populate a field instead. Multiple indicates that the index is used both in the search and to populate a field.

Finally, an index can be used to filter the AutoComplete results based on the value entered in another field. For this kind of index, set the behavior attribute to AdditionalSearch.

For example, AutoComplete is configured out of the box for address street names. Suppose you add an additional search index for the StreetNumber property. If the user enters a street number in the Street # field and then begins typing in the Street Name field, the AutoComplete service will only show results that match the specified street number.