SmartSearch not able to find all results

Breck Caine asked on September 9, 2021 18:51

There are a number of products that are not returning in my smart search, either through my application, or using the Search preview in cmsadmin. I can search for other products without issue, and I can see it in the database and even pull it up in my products page. This is the search string: +_culture:([en-us TO en-us] [invariantifieldivaluei TO invariantifieldivaluei]) +productobjecttype:transmissions +(SKUNumber:(1241D30097818)) cond=+ProductObjectType:transmissions

Is there some way to check and make sure this is associated correctly in Kentico?

I did refresh the index, and used SQL profiler to capture all DB calls and I could see it ran a query that would have picked up this product.

Recent Answers


David te Kloese answered on September 9, 2021 22:06

Probably there is a syntax thing... a number containing a character, accidental spaces or non visiual characters.

Since you can't find it in the preview it might not be indexed correctly, can you find the product at all on any other property?

If you really want to be sure if it's actually in the index you can have a look at application called "Luke"

https://code.google.com/archive/p/luke/

it allows you to check what is actually in lucene index files itself! Note you need to install Java, and there is not a lot of documentation. The version above should still work, but you can also check a newer take of same product: https://github.com/DmitryKey/luke

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on September 10, 2021 09:11

Are the product pages all of the same page type, in the same location? I would check that the index setup, the allowed content covers all the pages. Then, what is the analyzer used? And just to be sure, when you search for SKUNumber lets say 123, you will get desired result. But when you search for SKUNumber 456, you do not get any results?

0 votesVote for this answer Mark as a Correct answer

Breck Caine answered on September 13, 2021 15:57

I have products that are of the same type. When I search using SKUNumber or other fields from COM_SKU this one product (and potentially others) will not return. I do see the product in the database and through the application on it's product page. I did use the Luke tool mentioned above and I did find that SKUNumber. I am also able to pull the document using the API. It is only using SmartSearch that I am not able to retrieve this product.

DocumentQuery docs = DocumentHelper.GetDocuments("CMSProduct.Transmission") .Path("/Products/", PathTypeEnum.Children) .WhereLike("SKUNumber", "1241D30097818");

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on September 13, 2021 16:25

since you could find it in Luke... did you try searching the query you had above:

+_culture:([en-us TO en-us] [invariantifieldivaluei TO invariantifieldivaluei]) +productobjecttype:transmissions +(SKUNumber:(1241D30097818)) cond=+ProductObjectType:transmissions

it should give you the exact result Kentico get's back from the index.

I wouldn't be surprised if the character/capital "D" in your skuNumber is causing an issue...

0 votesVote for this answer Mark as a Correct answer

Breck Caine answered on September 13, 2021 17:08

Yes, I have tried that query in "Search Preview" for the Index. It brings back "No Results were found" Other SKUNumbers bring back results.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on September 14, 2021 11:35

If it happens for this value only, have you tried re-saving it or recreating the page? Maybe there is some whitespace character somewhere...

0 votesVote for this answer Mark as a Correct answer

Breck Caine answered on September 17, 2021 15:44

We are seeing this issue for many of the pages/products. They are in the database, but SmartSearch does not find them. It works find for many other products using the same search identifiers.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on September 20, 2021 06:55

This is really strange. We would need to know the steps how to reproduce the issue using a default Kentico installation. Could you please install a fresh copy of Kentico and reproduce the issue there and then tell us all the configuration details and steps? There is something strange going on I have never seen before. Or, when you create a testing index from scratch, are you still able to reproduce the issue?

0 votesVote for this answer Mark as a Correct answer

Breck Caine answered on September 20, 2021 19:54

I am still not sure why some of the products did not appear for smart search, but I deleted the bad documents and re-imported them, and everything is working fine now. Thanks very much for looking at this.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.