Exclude Episerver Forms properties for Episerver Search & Navigation



A recent request we got from a client was that the Search & Navigate result from a page containing a FormContainerBlock had its properties indexed and shown for the search page result. Like this:

When trying to exclude these types of settings in the FindInitialization conventions, they do not remove the properties from Find at all.

The following has been tried:

 // Exclude page (and possibly their descendents) from index if the page type inherits an interface or the property is set by an editor
var indexConventions = ContentIndexer.Instance.Conventions;
indexConventions.ForInstancesOf<FormContainerBlock>().ShouldIndex(x => false);

                .ExcludeField(x => x.SubmitSuccessMessage);

How could you achieve this in with a convention setting or ignore rule for Search & Navigation?



Aug 21, 2020 9:25

Did you run the Find reindexing scheduled job after updating conventions?

The changes does not take effect until the content is reindexed.

Edited, Aug 21, 2020 11:02

Yes, I have tried to empty it and rerun it with no results

Aug 21, 2020 11:02

Yes, I have tried to empty it and rerun it with no results

Aug 21, 2020 11:02

Is the FormContainerBlock inside an xhtmlstring property on the page? Or referenced by a contentreference property?

Edited, Aug 21, 2020 11:03

It is a block reference in a content area for an article page type (custom)

Aug 21, 2020 11:06

I do not think blocks inside content areas should be indexed by default.

Are you using this attribute for your block? If so, remove it.


Refer to: https://world.episerver.com/blogs/pjangid/dates/2019/4/indexing-blocks-content-to-make-it-searchable/

Aug 21, 2020 11:28

Hi, Tomas

We are indexing blocks with the IndexInContentAreas attribute enabled for most parts of the pagetypes for the solution.

This question however is more based on how to disable Episerver to index Form properties (default properties from the Forms dll:s) whom by misstake is being indexed. The content being indexed is being referenced from a ContentArea with the FormContainerBlock representing the content of the form.

This does not seem to be achievable with the ignore configures for the Search & Navigate API

Aug 26, 2020 6:52
* 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.