Copied to clipboard

Flag this post as spam?

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


  • Mark 255 posts 612 karma points
    Dec 04, 2013 @ 12:59
    Mark
    0

    Examine Search - only working in management dashboard

    Umbraco 6.1.5. Got a strange issue with Examine search. Consider the following code:

    UmbracoExamineSearcher searcher = (UmbracoExamineSearcher)ExamineManager.Instance.SearchProviderCollection["ListingPageContentSearcher"];

    IBooleanOperation query = searcher.CreateSearchCriteria()
      .Field("path", "2719") // must be descendent of this listing page
      .And()
      .GroupedOr(new string[] { "nodeTypeAlias" }, new string[] { "Download", "Link", "Article" }); // must be correct node type

    ISearchResults results = searcher.Search(query.Compile());

    I get no results back, which is not expected. (the path field has had commas replaced with spaces via GatheringNodeData event)

    The resulting lucene query when I hover my mouse over the query while debugging in Visual Studio is:

    +path:2719 +(nodeTypeAlias:download nodeTypeAlias:link nodeTypeAlias:article)

    If I then log into the CMS, go to the developer section, select the "Examine Management" tab, select the "ListingPageContentSearcher" searcher, expand "Search Tools", paste in the lucene query that I've copied from the debug window, select the "Lucene Search" option and click the "Search" button, hey presto, all my results appear!

    Does anyone have any idea what might be going on here?

Please Sign in or register to post replies

Write your reply to:

Draft