Copied to clipboard

Flag this post as spam?

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


  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Aug 17, 2010 @ 17:53
    Ismail Mayat
    0

    Examine whitespaceanalyzer issue

    I have the following query being generated by examine,

    +nodeTypeAlias:Product

    It returns no results , however when i run luke and use above query with standard analyser instead of whitespace analyzer i get results.  So i tried to update my ExamineSettings.config file from

     <add name="WOISearcher" type="UmbracoExamine.LuceneExamineSearcher, UmbracoExamine"
               analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net" indexSet="WOIIndexSet"/>

    to

    <add name="WOISearcher" type="UmbracoExamine.LuceneExamineSearcher, UmbracoExamine"
               analyzer="Lucene.Net.Analysis.StandardAnalyzer, Lucene.Net" indexSet="WOIIndexSet"/>

    However i get error Value cannot be null error and yellow screen of death. Am I missing a trick here?

    Regards

    Ismail

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Aug 18, 2010 @ 10:24
    Aaron Powell
    0

    Are you using the same analyzer to index and search? If you use different ones it can freak out.

    Have you checked out the post I did last week about understanding the indexes that are build uphttp://farmcode.org/post/2010/08/12/How-to-build-a-search-query-in-Examine.aspx

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Aug 18, 2010 @ 10:42
    Ismail Mayat
    0

    Slace,

    I am using same analyzers for both my config looks like

    <Examine>
      <ExamineIndexProviders>
        <providers>
          <add name="InternalIndexer" type="UmbracoExamine.LuceneExamineIndexer, UmbracoExamine"
               runAsync="true"
               supportUnpublished="true"
               supportProtected="true"
               interval="10"
               analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
    
          <add name="WOIIndexer" type="UmbracoExamine.LuceneExamineIndexer, UmbracoExamine"
         runAsync="true"
         supportUnpublished="false"
         supportProtected="false"
         interval="10"
         analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net" indexSet="WOIIndexSet"/>
    
        </providers>
    
    
      </ExamineIndexProviders>
      <ExamineSearchProviders defaultProvider="InternalSearcher">
        <providers>
          <add name="InternalSearcher" type="UmbracoExamine.LuceneExamineSearcher, UmbracoExamine"
               analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net"/>
    
          <add name="WOISearcher" type="UmbracoExamine.LuceneExamineSearcher, UmbracoExamine"
               analyzer="Lucene.Net.Analysis.WhitespaceAnalyzer, Lucene.Net" indexSet="WOIIndexSet"/>
    
    
        </providers>
      </ExamineSearchProviders>
    </Examine>

    I took a look at your blog post and my CreateSearchCriteria method did not pass in IndexTypes.Content so updated to that and now my query that outputs looks like

    { SearchIndexType: Content, LuceneQuery: +(+nodeTypeAlias:Product) +__IndexType:content }

    I get no results, if i run this query in luke but using whitespace analyzer i get no results. Run the same query but this time swapped to standard analyzer i get results.  Does the config allow swapping over of analyzer to Lucene.Net.Analysis.StandardAnalyzer it seems to go boom when you try.

    Regards

    Ismail

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Aug 18, 2010 @ 10:53
    Aaron Powell
    1

    What is the error you get? You should be able to swap out the analyzers, also if you don't set an analyzer you should get the StandardAnalyzer anyway.

    Try changing the analyzer (or not setting one) and reindex the document(s) in question (done by save & publishing the nodes).

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Aug 18, 2010 @ 11:09
    Ismail Mayat
    0

    Slace,

    Super high 5 you rock! Took out the analyzer attribute and as you say defaults to standard then rebuild my index all working. I love Examine I expect to have lots of fun with in future projects.

    Regards

    Ismail

  • Puppetmupp 4 posts 25 karma points
    Aug 21, 2012 @ 15:28
    Puppetmupp
    0

    I think your standard analyzer setting should be Lucene.Net.Analysis.Standard.StandardAnalyzer, not Lucene.Net.Analysis.StandardAnalyzer (forgot the Standard after Analysis).

Please Sign in or register to post replies

Write your reply to:

Draft