Copied to clipboard

Flag this post as spam?

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


  • Allan Michaelsen 14 posts 33 karma points
    Mar 11, 2011 @ 12:47
    Allan Michaelsen
    0

    Using UmbracoLucene fails with more than one searchword.

    I've implemented UmbracoLucene in its simplests form (I think). But it fals to find anything when i enter more than one word in the search field.

     

    ExamineIndex.config

        <IndexSet SetName="SiteSearchIndexSet" IndexPath="~/App_Data/ExamineIndexes/SiteSearch/">
    <IndexAttributeFields>
    <add Name="nodeName" />
    </IndexAttributeFields>
    </IndexSet>

    ExamineSettings.config

    <Examine>
    <ExamineIndexProviders>
    <providers>
    <add name="SiteSearchIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"
    supportUnpublished="false"
    supportProtected="false"
    interval="10"
    analyzer="Lucene.Net.Analysis.SimpleAnalyzer, Lucene.Net"
    indexSet="SiteSearchIndexSet" />
    .....

    <ExamineSearchProviders defaultProvider="SiteSearcher">
    <providers>
    <add name="SiteSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine"
    analyzer="Lucene.Net.Analysis.SimpleAnalyzer, Lucene.Net" indexSet="SiteSearchIndexSet" />
    .....

    Script:

    @{
      var searchString = umbraco.library.RequestQueryString("search");
      var searchProvider = ExamineManager.Instance.DefaultSearchProvider.Name;
      var searchResults = ExamineManager.Instance.SearchProviderCollection[searchProvider].Search(searchString, true);
    }
    <ul>

      @if(searchResults.Count() > 0)
      {
        <text>@Model.resultsFoundText</text>
        foreach (var result in searchResults)
        {
           <li><a href="@umbraco.library.NiceUrl(@result.Id)">@result.Fields["nodeName"]</a></li>
        }
      }
      else
      {
        <text>@Model.noResultsFoundText</text>
      }
    </ul>

     I think I've followed the guides to the letter and if I use Luke then i get results. Any ideas?

     

     

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Mar 11, 2011 @ 13:20
    Ismail Mayat
    0

    Allan,

    2 things change your analyser to standard rebuild your index (http://our.umbraco.org/projects/backoffice-extensions/examine-index-admin) and also you need todo wildcard query if you take a look at my previous forum posts (http://our.umbraco.org/search?q=examine%20wildcard&content=wiki,forumTopics,forumCategory,project,) there is some code on how todo this.

    Regards

    Ismail

  • Allan Michaelsen 14 posts 33 karma points
    Mar 12, 2011 @ 11:42
    Allan Michaelsen
    0

    Hi Ismail

    It's all good that I should use the standard analyser, but why do I need to use wildcard search? And do I need to change the source code for the "hack" you mention in your thread?

    What i don't get is why Luke can find my search terms when umbracoexamine can't.

    /Allan

  • Allan Michaelsen 14 posts 33 karma points
    Mar 14, 2011 @ 10:46
    Allan Michaelsen
    0

    Anyone has any other ideas og explanations?

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Mar 14, 2011 @ 12:35
    Ismail Mayat
    0

    Allan,

    Just did quick search on the forum and found http://our.umbraco.org/forum/developers/extending-umbraco/13931-Examine-search-every-word try splitting your terms out and build or query as per the post. I think out of box luke will do the same thing hence you are getting results.

    Regards

    Ismail

  • Allan Michaelsen 14 posts 33 karma points
    Mar 14, 2011 @ 20:59
    Allan Michaelsen
    0

    Hi Ismail

    That did it. :D

    "The powers of search are strong within this one... ", I thought had seached everything in here on examine, but guess not...

     

    Tnx

Please Sign in or register to post replies

Write your reply to:

Draft