Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jacob Distel 8 posts 28 karma points
    Jan 05, 2012 @ 23:35
    Jacob Distel
    0

    Examine standard analyzer only finds lowercase

    Hello,
    We're having issues with case sensitivity with our Examine search. 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]);

    }

    }

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 06, 2012 @ 10:17
    Dirk De Grave
    0

    Examine will index all data in lowercase format, so if you'd pass in a lowercase version of your search term, it will be returned from your searcher. No need to specify another analyzer for your indexer. I've done it before and works flawlessly

    Hope this helps.

    Cheers,

    /Dirk

Please Sign in or register to post replies

Write your reply to:

Draft