Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
We're having issues with case sensitivity in Examine. Every forum says to use the standard analyzer and rebuild the index, but that is not working. After doing so, our search only finds matching lowercase phrases.
Here is some of our code. Any suggestions?
<add name="MRCIndexer"
type="UmbracoExamine.LuceneExamineIndexer, UmbracoExamine"
dataService="UmbracoExamine.DataServices.UmbracoDataService, UmbracoExamine"
runAsync="true"
supportUnpublished="false"
supportProtected="false"
indexSet="MRCIndexSet"
interval="10"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>
<add name="MySearcher" type="UmbracoExamine.LuceneExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"
indexSet="MyIndexSet"/>
<IndexSet SetName="MRCIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/MRCIndex" IndexParentId="1204">
<IndexAttributeFields>
<add Name="id" />
<add Name="nodeName" />
<add Name="owner" EnableSorting="true" />
<add Name="writerName" />
<add Name="path" />
<add Name="nodeTypeAlias" />
<add Name="parentID" />
</IndexAttributeFields>
<IndexUserFields>
<add Name="titleMRC" />
<add Name="summary" />
<add Name="keywordsMRC" />
<add Name="content" />
<add Name="resourceContact" />
<add Name="testimonialName" />
<add Name="testimonialBusiness" />
<add Name="type" />
<add Name="service" />
<add Name="industry" />
<add Name="location" />
</IndexUserFields>
<IncludeNodeTypes>
<add Name="Resource Folder" />
<add Name="Resource" />
</IncludeNodeTypes>
<ExcludeNodeTypes />
</IndexSet>
var criteria = ExamineManager.Instance.SearchProviderCollection["MRCSearcher"].CreateSearchCriteria();
Examine.SearchCriteria.IBooleanOperation filter = null;
//Check to see what values have been searched for based on the query string and build the filter for search.
filter = criteria.NodeTypeAlias("resource");
if (Request.QueryString["key"] != null)
{
string[] SearchTermSplit = Split(Request.QueryString["key"], "+", "\"", true);
int i = 0;
for (i = 0; i < SearchTermSplit.Length; i++)
filter = filter.And().GroupedOr(new string[] { "titleMRC", "summary", "keywordsMRC", "content", "resourceContact", "testimonialName", "testimonialBusiness"}, SearchTermSplit[i]);
}
I think you should use same analyzer for Index and search: StandardAnalyzer.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Examine standard analyzer only finds lowercase
Hello,
We're having issues with case sensitivity in Examine. Every forum says to use the standard analyzer and rebuild the index, but that is not working. After doing so, our search only finds matching lowercase phrases.
Here is some of our code. Any suggestions?
<add name="MRCIndexer"
type="UmbracoExamine.LuceneExamineIndexer, UmbracoExamine"
dataService="UmbracoExamine.DataServices.UmbracoDataService, UmbracoExamine"
runAsync="true"
supportUnpublished="false"
supportProtected="false"
indexSet="MRCIndexSet"
interval="10"
analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>
<add name="MySearcher" type="UmbracoExamine.LuceneExamineSearcher, UmbracoExamine"
analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"
indexSet="MyIndexSet"/>
<IndexSet SetName="MRCIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/MRCIndex" IndexParentId="1204">
<IndexAttributeFields>
<add Name="id" />
<add Name="nodeName" />
<add Name="owner" EnableSorting="true" />
<add Name="writerName" />
<add Name="path" />
<add Name="nodeTypeAlias" />
<add Name="parentID" />
</IndexAttributeFields>
<IndexUserFields>
<add Name="titleMRC" />
<add Name="summary" />
<add Name="keywordsMRC" />
<add Name="content" />
<add Name="resourceContact" />
<add Name="testimonialName" />
<add Name="testimonialBusiness" />
<add Name="type" />
<add Name="service" />
<add Name="industry" />
<add Name="location" />
<add Name="owner" EnableSorting="true" />
</IndexUserFields>
<IncludeNodeTypes>
<add Name="Resource Folder" />
<add Name="Resource" />
</IncludeNodeTypes>
<ExcludeNodeTypes />
</IndexSet>
var criteria = ExamineManager.Instance.SearchProviderCollection["MRCSearcher"].CreateSearchCriteria();
Examine.SearchCriteria.IBooleanOperation filter = null;
//Check to see what values have been searched for based on the query string and build the filter for search.
filter = criteria.NodeTypeAlias("resource");
if (Request.QueryString["key"] != null)
{
string[] SearchTermSplit = Split(Request.QueryString["key"], "+", "\"", true);
int i = 0;
for (i = 0; i < SearchTermSplit.Length; i++)
{
filter = filter.And().GroupedOr(new string[] { "titleMRC", "summary", "keywordsMRC", "content", "resourceContact", "testimonialName", "testimonialBusiness"}, SearchTermSplit[i]);
}
}
I think you should use same analyzer for Index and search: StandardAnalyzer.
is working on a reply...