Copied to clipboard

Flag this post as spam?

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


  • Christian Bennich 11 posts 31 karma points
    Nov 04, 2010 @ 11:35
    Christian Bennich
    0

    Examine - simple setup

    Hi everybody

    I am playing around with Examin in 4.5.2.

    I have watched the Umbraco.TV episodes on Examine, and have set up a working index, and are able to search the index.

    I am trying to figure out a few things, and find some more "real" documentation - if it exists.

    How do I create a wilcard search - have tried searching userfield with data like '12345678' - would like to be able to wildcard search like '123*' - however when done - I receive no results - WHY?

    How does the IncludeNodeTypes tag really work. I have tried entering different DocumentTypeAlias values, but it does not seem to work, and I receive errors when trying to search.
    Is it not the DocumentTypeAlias that I should enter in the tag?

    Anyone knows where to find complete documentation on the Examine/UmbracoExamine??

    Hope anyone can help

    Christian

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Nov 04, 2010 @ 13:05
    Aaron Powell
    0

    Documentation for Examine is split across the FarmCode blog (http://farmcode.org/category/Examine.aspx) and the projects CodePlex page (http://examine.codeplex.com).

    Wildcard searching numerical data will probably fail a lot of the time, it'll depend on what analyzer you're using for the Indexer and Seacher, but even then I"m ot sure it'll work.

    IncludeNodeType will only have an effect when you add items to the index, if you don't republish any nodes then the index wont be updated to reflect the changes.

  • Christian Bennich 11 posts 31 karma points
    Nov 05, 2010 @ 23:01
    Christian Bennich
    0

    Thanks for the reply.

    I just can't seem to move on with the Examine thingy.

    I have read the articles on CodePlex and on FarmCode - not really helpful :-D

    Have tried using both the StandardAnalyzer and the WhiteSpaceAnalyzer - same result for both.

    Have tried adding different textfields to the index, wildcard searching on those instead - no luck.

    Have tried using a compiled ISearchCriteria - tried using the overload for Search, that takes a SearchString and bool, which was set to true, which states that the use of wildcards are supported, as parameters - my searchstring could be "s" or "somestring*".
    But no results.

    I can easily make wildcard searches in Luke.

    I am more or less ready to give up on this one for now.

    I haven't found any documentation that gives a full picture of how this is to be done. I wathed the video of Shannon Deminick at CodeGarden - at he seems to have it working.

    ANY HELP WOULD BE GREATLY APPRICIATED - i need to implement some search and would not want to fall back to xslt search - when this good looking new search option is there.

  • Christian Bennich 11 posts 31 karma points
    Nov 05, 2010 @ 23:24
    Christian Bennich
    0

    This is the code and configuration used:

    This is my indexer:

     <add name="DemoIndexer" type="UmbracoExamine.LuceneExamineIndexer, UmbracoExamine"
               runAsync="true"
               supportUnpublished="false"
               supportProtected="true"
               interval="10"
               analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"/>

    This is my searcher:

    <add name="DemoSearcher" type="UmbracoExamine.LuceneExamineSearcher, UmbracoExamine"
               analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" enableLeadingWildcards="true"/>

     

    This is my indexset:

     <IndexSet SetName="DemoIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/DemoIndex/">
        <IndexAttributeFields>
          <add Name="id" />
          <add Name="nodeName"/>
          <add Name="nodeTypeAlias" />
          <add Name="parentID" />
        </IndexAttributeFields>
        <IndexUserFields>
          <add Name="cvrNr"/>
          <add Name="cpr" />
          <add Name="navn" />
          <add Name="forsikringsTager" />
        </IndexUserFields>
        <IncludeNodeTypes/>
        <ExcludeNodeTypes />
      </IndexSet>

     

    This is the code that I use to search the index:

     var criteria = ExamineManager.Instance.SearchProviderCollection["DemoSearcher"].CreateSearchCriteria();
                var filter = criteria
                    .Field("cpr", TextBox1.Text)
                    .Compile();
                
                SearchResults = ExamineManager.Instance.SearchProviderCollection["DemoSearcher"].Search(filter);

                SearchResultListing.DataSource = SearchResults;
                SearchResultListing.DataBind();

  • Christian Bennich 11 posts 31 karma points
    Nov 08, 2010 @ 09:48
    Christian Bennich
    0

    WUWHUUUUU - Victory :-D

    Just needed to use the umbracoexamine.searchcriteria - and and the MultipleCharacterWildcard.

    It works!!!!!!!

Please Sign in or register to post replies

Write your reply to:

Draft