How can I hide a page from episerver find without requiring a reindex

  • Page Owner: Not Set
  • Last Reviewed: 2019-04-08

I'd like to give the editor the option to hide a page from Episerver find. How can I do this without having to re-index each time?


Additional Posts

Unified Search

Hide Content based on properties.

Using an episerver find search convention, you can force a field to always be evaluated in the results.

SearchClient.Instance.Conventions.UnifiedSearchRegistry
    .Add<ISearchDisable>()
    .AlwaysApplyFilter(c => c.BuildFilter<ISearchDisable>()
    .And(page => page.HideFromSearch.Match(false)));

Hide content based on type

Using the Content indexer search convention you can hide pages based on non changing properties

ContentIndexer.Instance.Conventions.ForInstancesOf<DocumentMedia>().ShouldIndex(x => true);

Note: This does not change when pages are edited or published. Do not use for things an editor can change. (See Hide Content based on properties)