Gravatar for rhowe@productiveedge.com

Question by howejr, Jan 14, 2015 2:27 PM

No Results on Searches

Hello,

I've been battling to setup Coveo for Sitecore for a couple days now and finally appear to be quite close. I can rebuild my indexes and see the indexes getting built through the console and admin tool. In addition the Diagnostics page in Sitecore shows everything green/ok.

Unfortunately, when I search for anything in Content Editor or deploy a simple search page and search, I'm always getting no results. I've installed CES on a remote server and Sitecore and the API on the same server. I've set a source name attribute as I'm going to have both a CM and CD environment.

If anyone has any suggestions on how to troubleshoot this, I'd really appreciate it.

Thank you Ryan

4 Replies
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Jan 14, 2015 2:50 PM

You can open your browser developer tools (F12) on the network tab and analyze the request of the search query done by the search page. The request URL is beginning with http://YourSitecoreInstance/coveo/rest/

You can look in the form data for:

  • q: the query you typed in the search box
  • aq: the advanced query terms
  • cq: the constant query terms

Look also the request response. It is supposed to be a JSON object with the results of the search query. It may contain an error message that will inform you on the underlying problem.

By default with an enterprise license, a Coveo search page will only display the "sitecore/content" item and descendants that are in the current language, have a layout and are not in a bucket folder or a media folder. You can customize it by editing the properties of the "Coveo Search" component of your search page.

If you try the search page in the Page Editor or Page Preview mode, the results will come from the Master index. If you try the published search page, the results will come from the Web index.

Gravatar for rhowe@productiveedge.com

Answer by howejr, Jan 14, 2015 3:16 PM

Thanks for the info, so I'm simply trying to search on words like "folder" or "template" as I have a newly installed Sitecore instance with Coveo for Sitecore installed. My form data looks like:

q:template

aq:(@syssource==("loyolatestsitecoremaster_index") NOT @ftemplateid7021==("adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97","fe5dd826-48c6-436d-b87a-7c4210c7413b"))

cq:(@flanguage7021=="en" @fz95xlatestversion7021=="1")

firstResult:0

numberOfResults:10

excerptLength:200

filterField:

enableDidYouMean:true

sortCriteria:Relevancy

queryFunctions:[]

rankingFunctions:[]

groupBy:[]

retrieveFirstSentences:true

timezone:America/Chicago

enableDuplicateFiltering:false

My Response looks like:

{"totalCount":0,"totalCountFiltered":0,"duration":265,"indexDuration":10,"requestDuration":250,"searchId":"c9eeeb17-44ac-454c-8717-1754d5cb0771","termsToHighlight":{"search":[]},"phrasesToHighlight":{},"queryCorrections":[],"groupByResults":[],"results":[]}

Any thoughts on how I can tell why it isn't returning results?

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jan 14, 2015 3:19 PM

You can check in the Coveo Administration Tool Index Browser and execute the same query to see if it returns any documents.

Gravatar for rhowe@productiveedge.com

Comment by howejr, Jan 14, 2015 3:22 PM

Yes, it shows over 6,000 items

I'm just entering the phrase "template" in the index browser though, is that sufficient?

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jan 14, 2015 3:35 PM

It is not sufficient. You should enter the concatenation of the q, aq and cq query expressions like this:

template (@syssource==("loyolatestsitecoremaster_index") NOT @ftemplateid7021==("adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97","fe5dd826-48c6-436d-b87a-7c4210c7413b")) (@flanguage7021=="en" @fz95xlatestversion7021=="1")

If it returns 0 documents, try removing some query parts until you found the one that is exluding all your items.

Gravatar for rhowe@productiveedge.com

Comment by howejr, Jan 14, 2015 3:39 PM

Thanks. I cut & pasted that and yes, I still get 1,749 results…

Gravatar for rhowe@productiveedge.com

Comment by howejr, Jan 14, 2015 4:06 PM

Thanks again for your help. As I mentioned I've been battling this for a couple days so I just went through and deleted the indexes, the Security Provider, and the Collection using the Admin Tool. I also went into the Sitecore configuration tool and provided values for SecurityProviderName and ServerUrl (as CES is remote).

Gravatar for rhowe@productiveedge.com

Comment by howejr, Jan 14, 2015 4:06 PM

I then restarted Sitecore, rebuilt all my indexes and am now getting results both through Content Editor as well as the test page (in preview and via URL after publish). Appreciate your help. Any thoughts on what was happening are welcomed but I'm guessing I had an issue looking in the wrong collection or with the security provider?

Thanks Ryan

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jan 14, 2015 4:15 PM

It may be a problem with the security provider that wasn't able to identify you.

Gravatar for rhowe@productiveedge.com

Comment by howejr, Jan 15, 2015 2:42 PM

I ultimately think my problem was due to building my indexes before my configuration was actually correct. As such, the indexes were created with a different security provider or collection and I believe Sitecore was just querying in the wrong location. I'm new to Coveo so this was my first installation on a different server. I'd try making sure the settings I mention above are set and possibly try to clear out your indexes and rebuild.

Gravatar for jrappel@parse3.com

Answer by jrappel, Jan 19, 2015 4:16 PM

I am now facing a very similar issue.

I pulled the form variables directly from the sitecore coveo query:

q=landing&aq=(%40syssource%3D%3D(%22MYINDEXNAME%22)%20NOT%20%40ftemplateid44305%3D%3D(%22adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97%22%2C%22fe5dd826-48c6-436d-b87a-7c4210c7413b%22))&cq=(%40flanguage44305%3D%3D%22en%22%20%40fz95xlatestversion44305%3D%3D%221%22)&firstResult=0&numberOfResults=10&excerptLength=200&filterField=&enableDidYouMean=true&sortCriteria=Relevancy&queryFunctions=%5B%5D&rankingFunctions=%5B%5D&groupBy=%5B%5D&retrieveFirstSentences=true&timezone=America%2FChicago&enableDuplicateFiltering=false

after cleaning it up…

landing (@syssource==("MYINDEXNAME") NOT @ftemplateid44305==("adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97","fe5dd826-48c6-436d-b87a-7c4210c7413b")) (@flanguage44305=="en" @fz95xlatestversion44305=="1")

This query returns zero results from the Coveo Search page in Sitecore. However, that same query returns 44 results in the Index Browser.

Going further, I then sent a custom POST request using the Sitecore Search page. I used fiddler and modified the request. I removed all other form variables, so my request looked like this:

q=landing&aq=(%40syssource%3D%3D(%22MYINDEXNAME%22)%20NOT%20%40ftemplateid44305%3D%3D(%22adb6ca4f-03ef-4f47-b9ac-9ce2ba53ff97%22%2C%22fe5dd826-48c6-436d-b87a-7c4210c7413b%22))&cq=(%40flanguage44305%3D%3D%22en%22%20%40fz95xlatestversion44305%3D%3D%221%22)

Theoretically, this should be the exact same query that I tested within the admin tool and yet I still receive no results.

Thanks again for any help.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jan 19, 2015 4:30 PM

You can open the Coveo Console while executing the query from Sitecore. Then, note the user that runs the query in the Coveo Console. Back in the index browser, do the query that returns 44 documents and check the permissions on those documents. Is the user executing the Sitecore query is allowed on the documents? If it is not allowed, then you need to give access to him to the Sitecore items and re-index.

Gravatar for robson.borgiani@dotz.com.br

Answer by robson_borgiani, Jul 5, 2015 12:30 PM

Hello, i´m having exactle same problem, I have a fresh coveo installation, and when I call the rest/search, returns 0.

Where I give access to user executing the sitecore query to allow him access to the item?

Gravatar for rhowe@productiveedge.com

Comment by howejr, Jul 6, 2015 8:08 AM

Ultimately, I believe I resolved this issue by clearing out my indexes and specifically Security Provider in the Admin Tool and doing a full rebuild of the indexes. I believe the issue had to do with having built the indexes and then tweaked settings which caused me to be querying with a different Security Provider name. In turn, once I got that settled, results started showing up.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Jul 6, 2015 9:47 AM

You can open the Coveo Console while executing the query from Sitecore. Then, note the user that runs the query in the Coveo Console. Back in the index browser, do the same query that returns documents and check the permissions on those documents. Is the user executing the Sitecore query is allowed on the documents? If it is not allowed, then you need to give access to him to the Sitecore items and rebuild your indexes.

To give access to the users, simply use the Security/Assign ribbon toolbar button directly in Sitecore.

Ask a question