- Search Interface Does Not Return the Expected Results
- Enabling the Interface Editor in Your Salesforce Organization
- Coveo-Powered Search Page Fails to Load After Upgrade
- Insight Panel Refuses to Display
- Unable to Install the Coveo Lightning Component for Community Cloud
- Error When Adding or Accessing Coveo Components in a Lightning Community
- Cannot See Values When Using an Existing Field in a Facet
- Unknown Page for the Current Site Configuration Error With Coveo Lightning Components
- Coveo Object Unavailable in Lightning Component
- The Feature is Not Activated for Your Organization
- Uncaught-DOMException-Failed-to-read-the-'responseText'-property-from-'XMLHttpRequest' Error Message When Using a Component
- Infinite Loading When Trying to Preview a Document in a Quick View
- Access Token Update Required
Search Interface Does Not Return the Expected Results
When querying your Coveo components, you get to the search page, and you either don’t have access to results, or don’t have all the results you expected to see.
There’s also no error message displayed.
There are two possible causes for this:
The user you’re using to query the component doesn’t have access to those items. This is the expected behavior.
One of the filters for your search page is either too restrictive or invalid.
To resolve this issue, you need to review the full query sent to the index, and perform the same query in the Coveo Cloud Administration Console.
Step 1: Ensure That the Item You Want Is Available in the Index
Under Content, select Content Browser.
To ensure that you can see all available items, select the Preferences button () at the end of the search bar, and check the View all content box.
Search for the item you want to see in your search results.
If you can find it, you can continue to Step 2.
If you can’t find it, your index doesn’t contain the item you want to find. You thus need to review the way your sources are configured, and then rebuild them (see Adding and Managing Sources).
Step 2: Get Your Search Page Full Query
Access your search interface, and open your browser console in the Network tab.
Perform a search on your page, which you would expect would return your desired results.
You should see two XHR requests to
platform.cloud.coveo.com, usually named
v2/. Select the last one.
In the Headers of the request, scroll to Form Data.
The q, aq, cq, dq, and lq elements can all change which items should and shouldn’t be displayed in your search interface.
Copy the value of all of those elements into the text editor of your choice.
You’ll most likely not be able to find all of the previously listed elements in the Form Data. This is because when a value is empty, it’s not sent.
Back in the XHR request, still in the Headers section, scroll to the Request Headers section.
Under Authorization, you should see an authorization token that looks like this:
Copy the full token, which starts with
Access JWT.io, and under Encoded, paste your token. You should see the decoded token under Decoded.
In the Decoded section, if you have a
filterelement, copy its value and paste it in your text editor.
Remember to change all instances of
", as the quotation marks won’t need to be escaped.
You may want to note the
userIdsused in your search interface, as they might become useful later.
In your text editor, add parentheses around the value of each element.
This will serve as your base query.
In your search page, you find that your form data sends the following query:
q: mobile aq: @objecttype==(Case, Knowledge) cq: @language=="English" NOT @filetype=="Image"
Your token also has the following filter in its token:
@source==\"My Salesforce Source\"
Your base query would look like this:
(mobile) (@objecttype==(Case, Knowledge)) (@language=="English" NOT @filetype=="Image") (@source=="My Salesforce Source")
Step 3: Test Your Query in the Content Browser
Access your Coveo Cloud Content Browser again, as in step 1 (see Step 1: Ensure That the Item You Want Is Available in the Index).
In the search bar of the Content Browser, enter the base query you got from Step 2 (see Step 2: Get Your Search Page Full Query).
Perform the search with your base query.
If you can find your item with the base query:
You made a mistake copying your base query. Ensure that you copied all the filters from your search page, and ensure it follows the Coveo Cloud query syntax (see Coveo Cloud Query Syntax Reference).
The user of your search page doesn’t have access to your item. You may need to verify that the users you got from the
userIdselement in your token has access to the item inside Salesforce, or whichever source your item comes from.
If you can’t find your item with the base query, you may continue this procedure, as it’s the expected outcome.
Granularly remove parts of your query, until you have identified which part of the query is preventing your item from being returned.
Once you have identified which part of the query is preventing the item from being returned, identify why it’s not returned.
Reasons might include: