We're using umbraco examine for searching and want to work out how to turn of case sensitivity for searches IE if we search for "Screwdriver" vs "screwdriver" we get different results. is there something in the search provider config or something we need to turn off?
It's not possible to turn it off, the only way to do it would be to access the DocumentIndexing event (which only exists on the LuceneExamineIndexer, not the BaseIndexer) and manually put the data into Lucene yourself.
Further more Lucene's case sensitivity in regards to searching is at an analyzer level, so it's not something would could always control.
IMO we should change it so that Examine doesn't force case insensitivity, it should come down to the analyzer
Yeah it's tricky because we can't get the desired search results because of case sensitivity.. meaning if one user does it one way another other with an upper case then the results really are quite varied...
I know this ia s pretty old post, but I am having a very similar problem but in my case the .ToLower does not look like it will help.
I am working on building a search with a raw Lucene query, but the result are definitely being handled as case sensitive for some reason.
For example: I have a recipe content node that is titled: "Easy Taco Pizza" When I search pizza I get no results, but if I search Pizza it will return that node.
Here is the code for building the Lucene query.
var searchProvider = ExamineManager.Instance.DefaultSearchProvider.Name; var searchCriteria = ExamineManager.Instance.SearchProviderCollection[searchProvider].CreateSearchCriteria(BooleanOperation.Or);
var query = searchCriteria.RawQuery(luceneString); var searchResults = ExamineManager.Instance.SearchProviderCollection[searchProvider].Search(query).OrderByDescending(x => x.Score);
Examine/Lucene turn of case sensitivity
Hi Guys,
We're using umbraco examine for searching and want to work out how to turn of case sensitivity for searches IE if we search for "Screwdriver" vs "screwdriver" we get different results. is there something in the search provider config or something we need to turn off?
Cheers,
Tom
It's not possible to turn it off, the only way to do it would be to access the DocumentIndexing event (which only exists on the LuceneExamineIndexer, not the BaseIndexer) and manually put the data into Lucene yourself.
Further more Lucene's case sensitivity in regards to searching is at an analyzer level, so it's not something would could always control.
IMO we should change it so that Examine doesn't force case insensitivity, it should come down to the analyzer
Yeah it's tricky because we can't get the desired search results because of case sensitivity.. meaning if one user does it one way another other with an upper case then the results really are quite varied...
Wait, do you mean that you're getting different results or you want to get different results?
we're getting different results.. ie search for screwdriver returns 10 results, search for Screwdriver returns 6 results for example..
If we tolowerinvariant the query it works for all.. it seems things are getting indexed lowered?
Hmm, I thought it should be case-insensitive, maybe you should do a .ToLower on the search term(s) before adding them to your query.
Test that with Luke and see how it reacts
Thanks slace! how's life at the farm?
Churning out the Umbraco goodness ;)
You coming to the meetup?
I'll check with the bosses! :) oh and when and where..
http://our.umbraco.org/events/sydney-umbraco-user-meet-up
I know this ia s pretty old post, but I am having a very similar problem but in my case the .ToLower does not look like it will help.
I am working on building a search with a raw Lucene query, but the result are definitely being handled as case sensitive for some reason.
For example: I have a recipe content node that is titled: "Easy Taco Pizza" When I search pizza I get no results, but if I search Pizza it will return that node.
Here is the code for building the Lucene query.
Any ideas what is going wrong?
Thanks!
is working on a reply...