Coveo Performance Tuning
I am reviewing performance on our current Coveo for Sitecore indexes and I'm looking to improve a few things but I am having trouble finding information on how to do this. One example of what we are trying to do is improve the performance of our autocomplete on our custom search box. The autocomplete is essentially doing a "StartsWith" on the the title field but this is taking between .35 and .45 seconds in the Coveo admin which is way too long with no load on the server. Is there any guidance/documentation on things that could be done to improve performance from an index structure standpoint. For example, could I pull all of the titles into a new index with just the title field and query that index rather than my web index?
@ssartell is right. You should use the first link he posted instead. You should put your @title field as a facet and use the REST call to list all its values. This call also accept wildcards. The performance will be highly improved.
I don't think we have a performance guide available. Here's what I know:
- If you use LINQ queries somewhere, follow the Optimizing LINQ Query Performance guide. Option 1 of this guide also applies if you are not using LINQ.
- Avoid using wildcard, fuzzy match, phonetic match and other special field query operators. They are the slowest operators available. Whenever possible, stand with simple free-text search, field contains keyword (=) and field exact match (==) operators.
- Avoid setting all the fields as free-text searchable, facet or sortable. Only set those attributes on needed fields.
- Avoid creating a free-text searchable computed index field with all the values of all the item fields. Use the Coveo indexed document body/binaryData feature instead. It is a property on an indexed document instead of a field. It is free-text searchable by nature and also used to create the document quickview and provide search result excerpt. (see Indexing Documents with HTML Content Processor)
- Limit the number of indexed fields to the minimum (either with includeField/excludeField config sections or coveoIndexingGetFields pipeline). Coveo for Sitecore indexes all the fields by default for customers to avoid complex configuration. A large number of fields will slow down the indexing and search processes. We are currently creating new intelligence to select fields to index in the upcoming December 2016 release.
- Connect only one Sitecore farm to a CES server or Coveo Cloud organization. Every Sitecore farm creates a ton of fields, 1 security provider and 2 sources and a few other things. The more you connect, the slower it will get.
- If you have a farm of more than one Sitecore server (CM/CD) connected to the same Coveo index, ensure your farmName value is the same in all the Sitecore instances to avoid having 2 Sitecore servers battling to update the Coveo index configuration. (see Installing Coveo for Sitecore in a CM or CD Configuration)
- If you use on-premises CES index and you experience slow indexing, check the ConfigObjectCache size.
- Avoid building a search interface that issues more than one search query per actual user search. One user query should execute only one search call to the index. Do not separate search results per type of content. Use a content type facet instead to drill down search results. This will ensure better relevancy, better performance, and accurate usage analytics data.
- Do not disable 15 minutes Coveo Cloud query/result cache by decreasing the
maximumAgeparameter value on queries.
- Do not insert dynamic query expressions in the constant expression part of the search query. This expression should be used only for really static filters that are hardcoded and will never change. All the constant expressions received by the index are inserted in a cache refreshed when documents are indexed. The bigger this cache, the slower indexing gets.
- When using Coveo Cloud index and using numeric fields in your query filters, ensure these numeric fields are marked to be cached in the index with
useCacheForNumericQuery(see Understanding the Coveo Search Provider's Configuration File)
- Avoid configuring a field as facet when most the indexed documents have a different field value. This creates a field with a very high cardinality and is slower.
- Avoid repeating a field name in a OR query like
@field=="Value1" OR @field=="Value2". Use parenthesis instead like
- Avoid adding multiple Query Ranking Expressions (QRE) with very similar expressions only different by their field value. Use a Query Function (QF) instead (see Query Function)
I hope this helps,