Copied to clipboard

Flag this post as spam?

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


  • Rob Watkins 369 posts 701 karma points
    Oct 03, 2013 @ 17:19
    Rob Watkins
    0

    Weird problems with path filters, Umbraco v6.1.5

    This is my first site using any kind of Examine based search and have been having problems with ezSearch I just can't work out.

    Added a page with some lorem ipsum text, and searched for lorem; but got no results, with any combination of macro parameters. Currently I am using all default, except searching only content.

    I installed the Examine Inspector and indexes and everything are fine, and could run the search in that and get what I expected.

    I currently have the search working by commenting out the lines that build path filtering in the query, but that is obviously not ideal.

    The weird behaviour is that I printed out the query being run:

    -umbracoNaviHide:1 +(__IndexType:content +searchPath:1048 -template:0) +(nodeName:lorem* metaTitle:lorem* metaDescription:lorem* metaKeywords:lorem* bodyText:lorem* ) nodeName:lorem*^5 metaTitle:lorem*^4 metaDescription:lorem*^3 metaKeywords:lorem*^2 bodyText:lorem*^1
    

    In ezSearch, this gives me no results - but in Examine Inspector I get loads of results which don't container lorem at all. Remove the path filter clause and both ezSearch and Examine Inspector return the expected result.

    I don't know enough about Lucene to have any idea where to start with this - are you able to shed any light?

  • Amalie Wowern 144 posts 273 karma points MVP c-trib
    Oct 14, 2013 @ 15:01
    Amalie Wowern
    0

    Hi

    I almost have the same problem.

    which line did you out comment?

  • Erik 9 posts 29 karma points
    Nov 12, 2013 @ 09:51
    Erik
    0

    I think it it these lines that Rob commented out:

            /*

            var contentPathFilter = model.RootContentNodeId > 0

                ? string.Format("__IndexType:{0} +searchPath:{1} -template:0", UmbracoExamine.IndexTypes.Content, model.RootContentNodeId)

                : string.Format("__IndexType:{0} -template:0", UmbracoExamine.IndexTypes.Content);

     

            var mediaPathFilter = model.RootMediaNodeId > 0

                ? string.Format("__IndexType:{0} +searchPath:{1}", UmbracoExamine.IndexTypes.Media, model.RootMediaNodeId)

                : string.Format("__IndexType:{0}", UmbracoExamine.IndexTypes.Media);

     

            switch (model.IndexType)

            {

                case UmbracoExamine.IndexTypes.Content:

                    query.AppendFormat("+({0}) ", contentPathFilter);

                    break;

                case UmbracoExamine.IndexTypes.Media:

                    query.AppendFormat("+({0}) ", mediaPathFilter);

                    break;

                default:

                    query.AppendFormat("+(({0}) ({1})) ", contentPathFilter, mediaPathFilter);

                    break;

            }

            */

     

     

    But these is not my main problem. It is that ranking/sorting is not working. It seems that my result page items are grouped for som reason. Were do I switch off the grouping of search resulta items?

     

Please Sign in or register to post replies

Write your reply to:

Draft