Copied to clipboard

Flag this post as spam?

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

  • Craig O'Mahony 364 posts 918 karma points
    Mar 07, 2019 @ 10:38
    Craig O'Mahony

    Examine search not filtering out umbracoNaviHide

    Hi all,

    I've got an Umbraco instance (7.6.4) and I'm attempting to use the Examine searcher to create a search (based on but I'm having trouble filtering out results where umbracoNaviHide to set to true on the node.

            ISearchCriteria searchCriteria = ExamineManager.Instance.CreateSearchCriteria(BooleanOperation.And);
            IBooleanOperation queryNodes = null;
            //only shows results for visible documents.
            queryNodes = searchCriteria.GroupedNot(new string[] { "umbracoNaviHide" }, "1");

    Has anyone experienced this or see what I'm doing wrong please?

    Thanks, C

  • Marc Love ( 391 posts 1308 karma points
    Mar 07, 2019 @ 10:53
    Marc Love (

    Hi Craig,

    I use this:

    Examine.Providers.BaseSearchProvider baseSearchProvider = ExamineManager.Instance.SearchProviderCollection["ExternalSearcher"];
    var criteria = baseSearchProvider.CreateSearchCriteria(IndexTypes.Content, BooleanOperation.And);
    var examineQuery = criteria.Not().Field("umbracoNaviHide", "1");
    results = baseSearchProvider.Search(examineQuery.Compile());



  • Craig O'Mahony 364 posts 918 karma points
    Mar 07, 2019 @ 12:03
    Craig O'Mahony

    Thanks Marc,

    Are you using an external index there?

    Thanks, C

  • Carlos Mosqueda 239 posts 428 karma points
    Jan 02, 2020 @ 21:04
    Carlos Mosqueda

    Hide 'umbracoNaviHide' node/page or other property given from Examine Search Results

    Depending on what you are doing with the search or the index. You could do something like this. (Umbraco 7+)

    This is what we use in our View/Template

        var q = Request.QueryString["q"];
        var Searcher = Examine.ExamineManager.Instance.SearchProviderCollection["MySearchSearcher"];
                q = "something if q is blank";
            var searchResults = Searcher.Search(q, true).OrderByDescending(x => x.Score);
       foreach(var item in results){
         var node = Umbraco.Content(item.Id);
        var url = node.Url;
      @*don't show my things that have 'umbracoNaviHide' (or this can be some other value) *@
          if(node.GetPropertyValue<bool>("searchEngineSiteMapHide") == false){
          <div><a href="@url">@node.Name</a></div>
       }@*end foreach*@


     <!--Add your own to this provider extension -->
         <add name="MySearchIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine" 
       supportProtected="true" interval="10"
       analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" indexSet="MySearch" directoryFactory="Examine.LuceneEngine.Directories.SyncTempEnvDirectoryFactory, Examine" />
     <ExamineSearchProviders defaultProvider="ExternalSearcher">
      <!--Add your own. -->
            <add name="MySearchSearcher" type="UmbracoExamine.UmbracoExamineSearcher, UmbracoExamine" analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net" indexSet="MySearch" enableLeadingWildcards="true" />


    <!--Custom indexer setup-->
    <!-- The index set used by for site search -->
       <IndexSet SetName="MySearch" IndexPath="~/App_Data/ExamineIndexes/MySearch/">
            <add Name="id" />
            <add Name="name" />
     <add Name="SomePropertyIMade" />
     <!--Add others if you want-->
      <add Name="NodeTypeIMade" />
        <!--Add others if you want-->
Please Sign in or register to post replies

Write your reply to: