Or, if you're using the latest version of Examine (1.0) you could change your analyzer to one that isn't case sensitive. Just guessing here, but chances are your indexer and searcher in ExamineSettings.config have a line like this:
The majority of the time (ie - unless you really understand what the analyzers are doing and are writing one yourself) you should be using the same analyzer for indexing and searching.
"But you said if i changed it than it will take the lowercase out."
That's not what I said :P
Anyway, upgrade to the latest Examine (if you haven't already), use the StandardAnalyzer (for both, as slace said), forget about case sensitivity. The only reason you need to worry about what's going in to the index is if you want to output it. Slace' instructions a few posts up will help you with that.
In my case, I have tried to clear that index folder and trigger publish via right click but doens't work. I have to save and publish for each page then it will create the index.
do you know how to call the API to rebuild the index ?
You only have to publish one page for an indexing to run on every page when no index exists. This has to be a save & publish, reloading content will not do it.
Examine Search Incase sensitive
Hi All,
I am using Examine Search, however the results match with case sensitive mode.
For example, your search string = "home" and "Home" has diffrent result
Is that possible to tell Examine search criteria not to use INCASE sensitive mode ?
==== Here is the code ====
var criteria = ExamineManager.Instance
.SearchProviderCollection[UmbracoSearchProvider.NewQuaySearcher]
.CreateSearchCriteria(IndexTypes.Content);
var filter = criteria
.GroupedOr(
new string[]
{
UmbracoSearchField.NodeName,
UmbracoSearchField.NavigationLabel,
UmbracoSearchField.HeaderText,
UmbracoSearchField.SummaryText,
UmbracoSearchField.BodyText,
UmbracoSearchField.Advertisement,
UmbracoSearchField.CompanyName,
UmbracoSearchField.Address,
UmbracoSearchField.CreditText
}
, searchTerm)
.Not()
.Field(UmbracoSearchField.UmbracoNaviHide, "1")
.Compile();
var rawResult = ExamineManager.Instance
.SearchProviderCollection[UmbracoSearchProvider.NewQuaySearcher]
.Search(criteria)
.Distinct()
;
Thanks
I found it, I just need to put searhTerm.ToLower(). because examine is put everything into lower case.
http://www.farmcode.org/?tag=/umbraco+examine+umbraco-examine+.net
But it seems I can't search for contains...
such as I can search for "about"
but if I search for "abo" - my about page is not comming up.
Is that possible to search (not Exact) word ?
Thanks
Or, if you're using the latest version of Examine (1.0) you could change your analyzer to one that isn't case sensitive. Just guessing here, but chances are your indexer and searcher in ExamineSettings.config have a line like this:
Which can be changed to:
Rebuild your index, and you should find it's case insensitive without any more effort.
Refer to this article on text casing with Examine: http://farmcode.org/post/2010/08/23/Text-casing-and-Examine.aspx
Hi Ben,
Which one should I change ? Is it the Examine Index provider / the Search provider ?
Can I use Index Provider = whitespace and search provider is standard ? Is this will work ?
In Farmcode blog said that these analyzer is lowercased.
But you said if i changed it than it will take the lowercase out.
Thanks
The majority of the time (ie - unless you really understand what the analyzers are doing and are writing one yourself) you should be using the same analyzer for indexing and searching.
"But you said if i changed it than it will take the lowercase out."
That's not what I said :P
Anyway, upgrade to the latest Examine (if you haven't already), use the StandardAnalyzer (for both, as slace said), forget about case sensitivity. The only reason you need to worry about what's going in to the index is if you want to output it. Slace' instructions a few posts up will help you with that.
Ok,.. Thanks for you help.
Do you know when this will be reindex ?
Is it when the application starts / when you start republish the whole site ?
Thanks
The index is only rebuilt under the following conditions:
In my case, I have tried to clear that index folder and trigger publish via right click but doens't work.
I have to save and publish for each page then it will create the index.
do you know how to call the API to rebuild the index ?
Thanks
You only have to publish one page for an indexing to run on every page when no index exists. This has to be a save & publish, reloading content will not do it.
is working on a reply...