How to use Examine Search in case insesitive mode?
I have an Examine search on my website and want to return same results whether I input lower or upper case keyword eg. same results should be expected when I search for 'nature' and 'Nature'.
Currently I get some results for 'nature' but nothing for 'Nature'.
I was using Lucene.Net.Analysis.WhitespaceAnalyzer by default.
After changing analyser did you rebuild the index. Also can you show me your search code. How do you get the searcher.
Also on your ProductsIndexer any reason why you are setting supportUnpublshed=true this will result in unpublihsed content being searchable on the front end.
What are you setting examineSearcherName to? Also why are you going through the extra over head of filtering unpublished stuff when you can just not have them in the index?
you provided the setup, in the code in the method GetSearchResultAsync(string examineSearcherName,
what is examineSearcherName I am trying to determine if you are passing default searcher in which case you are searching on the external index or are you searching on the product index. Also when you say you get different results for different case are they different or is it just the order of the results is different.
can you do searchCriteria.ToString() this will give you the generated lucene query can you report back what is generated when you search lower and uppercase.
How to use Examine Search in case insesitive mode?
I have an Examine search on my website and want to return same results whether I input lower or upper case keyword eg. same results should be expected when I search for 'nature' and 'Nature'.
Currently I get some results for 'nature' but nothing for 'Nature'.
I was using
Lucene.Net.Analysis.WhitespaceAnalyzer
by default.I tried to change the indexer and searcher to use
Lucene.Net.Analysis.Standard.StandardAnalyzer
as per advice here https://our.umbraco.com/forum/developers/extending-umbraco/14449-Examine-Search-Incase-sensitive but it doesn't do the job - I still get different results.My ExamineSettings:
Is there any other way I could try?
Manila,
After changing analyser did you rebuild the index. Also can you show me your search code. How do you get the searcher.
Also on your ProductsIndexer any reason why you are setting supportUnpublshed=true this will result in unpublihsed content being searchable on the front end.
Regards
Ismail
Yes, I rebuilt the index - I deleted the index folder and let the indexer recreate it.
I'm filtering out unpublished content before outputting to the front end.
This is my code so far:
What are you setting examineSearcherName to? Also why are you going through the extra over head of filtering unpublished stuff when you can just not have them in the index?
Regards
Ismial
How does the actual name of the searcher matter for the case-sensitivity of results?
It's not the worry of this thread whether I filter the results or not. Can you stick to the topic please?
I need to know which searcher you are using to figure out which index you are using.
I provided them in my initial post.
you provided the setup, in the code in the method GetSearchResultAsync(string examineSearcherName,
what is examineSearcherName I am trying to determine if you are passing default searcher in which case you are searching on the external index or are you searching on the product index. Also when you say you get different results for different case are they different or is it just the order of the results is different.
One more thing before this line
return await System.Threading.Tasks.Task.Run(() => {
can you do searchCriteria.ToString() this will give you the generated lucene query can you report back what is generated when you search lower and uppercase.
Ismail
I'm searching on the product index not the default one.
The queries I get respectively:
As I said: Currently I get some results for 'nature' but nothing for 'Nature'.
Clearely it's not the order that is my worry but different results whatsoever.
Can you show me your examineindex.config file i need to see show you are storing the description field.
Regards
Ismail
is working on a reply...