November Happy Hour will be moved to Thursday December 5th.

Does Find respect "noindex"?

Vote:
 

I've created a test page which contains the tag . However, this page still shows up in Find's search results. Thus, is the default behavior for Find not to respect the "noindex" tag?

#140912
Nov 03, 2015 17:54
Vote:
 

Are you using the crawler, i.e. an index with 'Connections', and crawling the website? If not, Find won't know about your meta tags since it's just indexing your content types by listening to when content items are updated.

#140923
Nov 03, 2015 22:06
Vote:
 

No, I'm not using the crawler.

Is there any best practice way to set a flag for not indexing a certain object? (I can find "Ignoring properties" in the documentation, but nothing about whole objects.)

#140931
Nov 04, 2015 9:49
Vote:
 

You can control this by conventions, please see http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/10/Integration/EPiServer-75/Indexing/.

Given I have a property called ExcludePageFromSearch in my base class for all page types, I usually create an extension method that checks if the editor wants to exclude that page:

public static FilterBuilder<T> ExcludeEditorChosenPages<T>(this FilterBuilder<T> filterBuilder)
    where T : IContent
{
    return filterBuilder
        .And<T, SitePageDataBase>(x => x.ExcludeFromSearch.Match(false));
}

Then I call this method from an initializable module:

SearchClient.Instance.Conventions.UnifiedSearchRegistry.ForInstanceOf<PageData>()
    .PublicSearchFilter(client => client.BuildFilter<PageData>()
        .ExcludeEditorChosenPages());
#140932
Nov 04, 2015 10:05
Vote:
 

Oh, and the reason I'm using a filter and not excluding the pages from the index completely, is because they should still be searchable in edit mode.

#140934
Nov 04, 2015 10:07
Vote:
 

You might be looking for:

//using EPiServer.Find.Cms.Conventions;
ContentIndexer.Instance.Conventions
  .ForInstancesOf<PageTypeToNotIndex>()
  .ShouldIndex(x => false);
#140935
Nov 04, 2015 10:09
Vote:
 

In addition to Johans great suggestions I have made a post on how to filter this on indexing, read more here:

http://world.episerver.com/blogs/Henrik-Fransas/Dates/2015/5/adding-episerver-find-to-alloy---part-2/

#140943
Nov 04, 2015 14:23
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.