Try our conversational search powered by Generative AI!

Episerver Find - Exclude Fields

Vote:
 

If I use the following query, Episerver Find will search in CreateBy and ChangedBy fields:

var searchResult = _findClient.Search()
    .For("some text")
    ...
    .GetContentResult();

For example, search on Administrator will return all pages that were created by admin.

InField extension doesn't solve the problem because not all classes that implement IMyInterface have the same set of properties.

What would be the most elegant way to solve this? Thanks!

#183442
Oct 13, 2017 13:10
Vote:
 

Could you use Find conventions to exclude the property from being indexed?

https://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-Find/8/DotNET-Client-API/Customizing-serialization/Excluding-fields/

https://world.episerver.com/documentation/Class-library/?documentId=find/8/8F9A2B37

#183452
Oct 13, 2017 18:23
Vote:
 

You should also be able to solve it in your own SearchText() extension method.

#183463
Oct 16, 2017 0:03
Vote:
 

I'd like to exclude fields from search, not from the search index.

In Elasticsearch it is possible to do the source filtering, so I was hoping it's possible to achieve the same with Find.

#183468
Edited, Oct 16, 2017 9:41
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.