We are using examine to search our content. When I search the index in the search tool under Examine Management I can see that a specific query is found in grid components. But in my code where I try to get results from the search provider, it gives me nothing for content based in a grid. I get hits for other properties in standard pages.
_searcher = ExamineManager.Instance.SearchProviderCollection[$"{searcherName}-Searcher"]; (I checked that searcherName is correct)
I added "grid.Standard Row" & "grid.Project Row" to existing code to see if that would help. But it did not and in the index it seems like those only contain IDs.
Should I add some other keyword to the "properties list"?
Or is there some other way to solve this?
If you look at index under the settings tab, you can look at was in in the result from the index (just search for the id of the page).
The content of the grid controls are just the content you input - the full text of an RTE, the value of a string field etc. If you pick an image, only the id is stored.
When I inspect my index and search for 'utveckling' I get these hits of the exact same page type (componentpage). But the first one shows the property '_Rawgrid' instead of 'grid' as in the other hit. And the property 'grid' refers to 2 numbers. I can't see the difference between these two, and it seems like this affect my search results as well. Any idea why this is so?
Search grid components with Examine
We are using examine to search our content. When I search the index in the search tool under Examine Management I can see that a specific query is found in grid components. But in my code where I try to get results from the search provider, it gives me nothing for content based in a grid. I get hits for other properties in standard pages.
_searcher = ExamineManager.Instance.SearchProviderCollection[$"{searcherName}-Searcher"]; (I checked that searcherName is correct)
var searchCriteria2 = searcher.CreateSearchCriteria(); _query = searchCriteria2.GroupedOr(new string[] { "nodeName", "heading", "title", "shortDescription", "mainBody", "grid", "grid.Standard Row", "grid.Project Row" }, _searchstring.MultipleCharacterWildcard()).And().Field("nodeTypeAlias", "componentService").Compile(); var results = _searcher.Search(query);
I added "grid.Standard Row" & "grid.Project Row" to existing code to see if that would help. But it did not and in the index it seems like those only contain IDs.
Should I add some other keyword to the "properties list"? Or is there some other way to solve this?
Thank you in advance for any guidance!
Hi Josef,
If you look at index under the settings tab, you can look at was in in the result from the index (just search for the id of the page).
The content of the grid controls are just the content you input - the full text of an RTE, the value of a string field etc. If you pick an image, only the id is stored.
If you need to expand the text, you may find some inspiration from this old gist : https://gist.github.com/abjerner/bdd89e0788d274ec5a33
HTH :)
Hi Søren and thanks for your reply.
Sorry for my late answer. Just before I read your reply, I realized that the problem for us was using the search criteria in the wrong way.
But your code looks interesting, and if we don't get the result we want, I might do something like that to improve our search.
Cheers, Josef
When I inspect my index and search for 'utveckling' I get these hits of the exact same page type (componentpage). But the first one shows the property '_Rawgrid' instead of 'grid' as in the other hit. And the property 'grid' refers to 2 numbers. I can't see the difference between these two, and it seems like this affect my search results as well. Any idea why this is so?
Another late reply.
I think that you need to escape spaces in field names in queries.
grid.Project Row
should begrid.Project\ Row
At least when running a query in "Examine management" tab in the back office.
Thank you, I will try to add that to my code and verify in next release.
is working on a reply...