Copied to clipboard

Flag this post as spam?

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


  • Griffi 1 post 81 karma points
    Jun 07, 2018 @ 10:23
    Griffi
    0

    Exclude folder

    Has anyone found an easy way to exclude pages from examin index.

    I tried exclude node but with no luck. I have hidden area but these pages show up in search results.

    thanks

  • Andy Felton 185 posts 484 karma points c-trib
    Jun 07, 2018 @ 17:08
    Andy Felton
    1

    Hi Griffi,

    Are you using the standard method within Umbraco to protect an area of the site? If so by default the ExternalIndexer should exclude protected and unpublished pages:

        <!-- default external indexer, which excludes protected and unpublished pages-->
        <add name="ExternalIndexer" type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"/>
    

    If you want these pages to show for certain members this blog https://thecogworks.com/blog/posts/examiness-hints-and-tips-from-the-trenches-part-9-secure-searching/ may provide some help.

    Hope that helps Andy

  • Andy Felton 185 posts 484 karma points c-trib
    Jun 09, 2018 @ 07:55
    Andy Felton
    0

    Hi,

    I've just done a little more investigation on this and it seems that the indexer correctly removes the node marked as protected but then indexes it's children.

    Not quite what I expected!

    Andy

  • Andy Felton 185 posts 484 karma points c-trib
    Jun 09, 2018 @ 08:48
    Andy Felton
    0

    Hi,

    Using the standard indexer does work but it appears as if you have to republish the folder of the now private content.

    I've checked the External Index with Luke and after switching the node to private and republishing none of the child nodes are in the examine index!

    Hope that helps Andy

  • Nigel Wilson 945 posts 2077 karma points
    Jun 07, 2018 @ 19:50
    Nigel Wilson
    1

    Hi Griffi

    The only way I have achieved this is to include the umbracoNaviHide (or some other property on the document type) in the search index, and then iterate through the search results and exclude any results that have the property set.

    Not sure if there is a better way, but it works.

    Nigel

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Jun 07, 2018 @ 21:28
    Dan Diplo
    100

    In ExamineIndex.config (in /config/) you can exclude specific document types and fields from being indexed eg.

      <IndexSet SetName="MyIndexSet"
            IndexPath="~/App_Data/TEMP/ExamineIndexes/MyIndex">
        <IndexUserFields>
          <add Name="heading" />
          <add Name="summary" />
          <add Name="bodyText" />
          <add Name="metaDescription" />
          <add Name="metaKeywords" />
          <add Name="doNotIndex" />
        </IndexUserFields>
        <ExcludeNodeTypes>
          <add Name="secretDocument" />
        </ExcludeNodeTypes>
      </IndexSet>
    

    This won't index any document types with an alias of secretDocument

    If you want more complex exclusions you'll need to write your own indexer - this isn't as hard as it seems as you can inherit from the base UmbracoContentIndexer and then override the AddDocument method. Within there you can add custom logic to decide what is indexed or not.

Please Sign in or register to post replies

Write your reply to:

Draft