--- title: Troubleshoot querying issues slug: '1870' canonical_url: https://docs.coveo.com/en/1870/ collection: searching-with-coveo source_format: adoc --- # Troubleshoot querying issues This article covers the most common querying issues that aren't caused by performance issues. Use the following guidelines to troubleshoot your issue before you contact [Coveo Support](https://connect.coveo.com/s/case/Case/Default) for help. ## Query syntax is disabled By default, the Coveo query syntax is disabled in Coveo JavaScript Search interfaces. However, the query syntax may be enabled by an administrator or a developer through the [enableQuerySyntax](https://coveo.github.io/search-ui/components/querybox.html#options.enablequerysyntax) `QueryBox` option. > **Note** > > For legacy [hosted search pages](https://docs.coveo.com/en/1656#edit-a-legacy-hosted-search-page), you can also enable the Coveo query syntax using the [Interface Editor](https://docs.coveo.com/en/1852/). > To do so, access the **Searchbox Options**, and then click the **Advanced Options** button. > You can then check the **Enable query syntax** box, and then click **Apply**. When the Coveo query syntax is disabled: * The [exact phrase match](https://docs.coveo.com/en/1686/) (keywords between quotes) still works. * All non-alphanumeric characters in a query except for the underscore (`_`), apostrophe (`'`), asterisk (`*`), question mark (`?`), and space characters are converted into dots (`.`) and are therefore considered as contiguity characters. These characters indicate that the group of words must be searched together as a single expression. **Example** You search for `canada+shopping+mall`. After the non-alphanumeric character conversion, your query becomes `canada.shopping.mall`, which is equivalent to the [phrase](https://docs.coveo.com/en/1686/) `"canada shopping mall"`. So, only items containing the phrase `canada shopping mall` are returned in your search results. Conversely, if you search for `canada shopping mall` (with regular space characters between the keywords), your search results consist of items in which `canada`, `shopping`, and/or `mall` appear. * The `?` and `*` wildcard characters can still be enabled independently through the [enableQuestionMarks](https://coveo.github.io/search-ui/components/querybox.html#options.enablequestionmarks) and [enableWildcards](https://coveo.github.io/search-ui/components/querybox.html#options.enablewildcards) `QueryBox` options respectively. ## Expected search result not returned A search that doesn't return the expected [query](https://docs.coveo.com/en/231/) results is a very common issue. The typical causes are insufficient effective permissions when content is secured, and an improper query formulation. ### Effective permissions When your index includes content from a [source that indexes permissions](https://docs.coveo.com/en/1779#same-users-and-groups-as-in-your-content-system), an [item](https://docs.coveo.com/en/210/) might not appear in the search results [because the querying user isn't allowed to access it](https://docs.coveo.com/en/1719/). Use the [Administration Console](https://docs.coveo.com/en/183/) to [review effective item permissions](https://docs.coveo.com/en/1712#permissions-tab) and check whether access to the desired item is allowed or denied for the querying user. > **Note** > > Users to which access to an item is both allowed and denied don't see this item in their search results, since a `Denied` permission prevails over an `Allowed` permission. > > For example, John Smith is a member of both the `Occupational Health and Safety Committee` group and the `R&D` group, and wants to access the `2017-05-12 Meeting Agenda` item. > In the `2017-05-12 Meeting Agenda` item permissions, the `Occupational Health and Safety Committee` group is allowed to access the desired item, but the `R&D` group is denied access. > For this reason, John Smith can't access `2017-05-12 Meeting Agenda`. ### Query formulation A query may also return unexpected search results because the end user inadvertently included unusual filters, incorrect [query expressions](https://docs.coveo.com/en/2830) or [query syntax](https://docs.coveo.com/en/181/), or a [`NOT` operator](https://docs.coveo.com/en/1814#not). Hidden filters can be associated with the search hub or tab to narrow search results. * You can revise the syntax used in your query by referring to the examples listed in [query syntax](https://docs.coveo.com/en/1552/). Correcting the syntax can help build more relevant search results. * You also can use your browser developer tools to [inspect the query](https://docs.coveo.com/en/1199#inspecting-a-query) sent by your search interface. Contact [Coveo Support](https://connect.coveo.com/s/case/Case/Default) for help in analyzing this issue. ### Query syntax is enabled If you're searching for error messages that contain several special characters, you might not receive the expected results because [query syntax](https://docs.coveo.com/en/181/) is enabled. Special characters in the error messages can be interpreted by [query syntax](https://docs.coveo.com/en/181/) as contiguity operators, and the query will return results for matching phrases instead. To get the expected results, you can disable [query syntax](https://docs.coveo.com/en/181/). See [Query syntax](https://docs.coveo.com/en/1552/) and the [`enableQuerySyntax` component options](https://coveo.github.io/search-ui/components/querybox.html#options.enablequerysyntax) for more information. ## Facets not showing properly If you search for a given field and an expected [facet](https://docs.coveo.com/en/198/) value isn't returned while other values are, your search page [injection depth](https://coveo.github.io/search-ui/components/facet.html#options.injectiondepth) may be too low. By default, the injection depth, or the number of top search results that are scanned to find possible facet values, is 1000. When building your search page facets, you can increase the value up to 2^31^, but keep in mind that as the injection depth goes up, it will have an increasing impact on performance. To determine the right injection depth for your search, contact [Coveo Support](https://connect.coveo.com/s/case/Case/Default). ## Sort order not applied You can customize your search page code to add a [link allowing users to sort results by a non-standard field](https://coveo.github.io/search-ui/components/sort.html). When sorting results by a custom field, it may seem that the sorting order you chose doesn't apply. This can happen because you're searching for child items in a parent/child relationship, and the parents and children don't necessarily have the same value in the sorting field. The search results are sorted using the sorting field value for the child item, but in the search results, parent items are shown first, with the corresponding child items indented underneath, sorted as desired. However, if you look at the parent sorting order, the results may appear unsorted. **Example** You're searching for PDF items attached to emails. You go on the **My Emails** tab of your [search interface](https://docs.coveo.com/en/2741/), enter your query followed by `filetype:pdf`, and then click **Date** to sort the results by date in descending order. The search results are displayed as follows: * Email dated 2017-05-04 ** PDF dated 2017-05-04 * Email dated 2016-10-08 ** PDF dated 2015-12-11 ** PDF dated 2015-02-06 * Email dated 2017-02-10 ** PDF dated 2014-10-09 While issues don't seem to be sorted by date, PDF attachments are indeed sorted by date in descending order. Validate how a custom sorting behaves in search interfaces where child results are folded under parent results. Consider removing a counter-intuitively behaving sorting to prevent confusing end users. ## Did You Mean feature The [_Did You Mean_ feature](https://docs.coveo.com/en/1810/) suggests a modified query when the original query contains spelling mistakes and doesn't return enough results. The _Did You Mean_ algorithm compares the queried term and the most occurring similar terms in the index, and then computes the [edit distance](https://en.wikipedia.org/wiki/Edit_distance) units (or typographical errors) between them. For the algorithm to suggest a term, this term must occur significantly more in the index than the queried term for each unit of distance between them. The number of results that a query yields has no impact on the algorithm. **Example** `distnace` is one unit of edit distance from `distance`, whereas `ditsnace` is two. Therefore, the algorithm requires fewer occurrences of `distance` in your index to suggest it when you query `distnace` than when you query `ditsnace`. If an alternative term yields fewer occurrences than the required number, the _Did You Mean_ algorithm doesn't suggest it. This can happen when the correct term is more common than the misspelled term, but isn't included in items that the other queried items match. > **Notes** > > * The _Did You Mean_ feature doesn't take the query context into account, that is, a word considered incorrect may appear frequently near the other queried words. > The feature may therefore suggest a corrected query that returns fewer results. > > * [Coveo Machine Learning](https://docs.coveo.com/en/1727/) also makes suggestions, along with content recommendations based on the query. ## Special characters and patterns Special characters are non-alphanumeric characters such as punctuation marks, quotation marks, currency symbols, and mathematical operators. Coveo doesn't index special characters, and if queried, these characters are ignored, that is, considered as a whitespace character. Therefore, querying for a term containing a special character may not return the expected result. **Examples** * Query `jsmith@mycompany.com` will be interpreted as `jsmith mycompany com` and will return items that match these keywords. * When searching for phone number `(418) 263-1111`, whether you put the area code in parentheses or not is irrelevant. Since the parentheses and the dash are ignored when queried, all items matching these three series of numbers will be returned, regardless of the phone number format. * When searching for `iPhone 6+`, items including `iPhone 6` and `iPhone 6+` will be returned. However, some special characters can be used to formulate advanced [query syntax expressions](https://docs.coveo.com/en/1552/). Specifically, you can perform very powerful searches by leveraging facet fields and [advanced query operators](https://docs.coveo.com/en/1897/). Since advanced field operators only use facet values, they can access all characters in the facet value, therefore making it possible to use patterns to search for anything. > **Note** > > JavaScript Search page developers can [enable or disable wildcard match](https://coveo.github.io/search-ui/components/querybox.html#options.enablewildcards) (`enableWildcards` option) independently from the Coveo query syntax. ## FAQ The following are frequently asked questions when troubleshooting querying issues. ### Why aren't results showing on my tab? When there are no results showing on a tab, a common issue is that a [filter](https://docs.coveo.com/en/3410/) has been applied to all searches, thereby causing no results to display. Remove this filter from your query pipeline. ### Why is the relevance of some of the first results not as expected? The [ranking and boosting rules](https://docs.coveo.com/en/3412/) in your query pipeline may not be properly configured. Try adjusting them to bring the preferred items to the top. ### Why am I getting different results when searching with keywords? When a specific item isn't showing up in the search results despite matching the keyword, there can be different reasons. This can include issues with synonyms, stemming, and proper indexing of terms. For example, you have an item named `scuba`, and yet it doesn't appear when you search for `scuba gear`. [Check that the item is indexed](https://docs.coveo.com/en/2053/) and that there are no [filters](https://docs.coveo.com/en/3410/) or [query parameters](https://docs.coveo.com/en/3411/) excluding it from the results. Another reason may be a misconfiguration of [search terms](https://docs.coveo.com/en/3440/) in your query pipeline. The pipeline should be configured to handle variations in keyword searches effectively.