Try our conversational search powered by Generative AI!

Exclude certain entries in index from unified search



I have some properties in the index (urls etc) that we would like to not get a hit in when we do an unified search.

Is there a way (an attribute, filter etc) to exclude certain properties from an unified search? We need them in the index. just not in the excerpt that is displayed.

Feb 07, 2014 9:42


how have you built your query? Here is an example on how the fields are being searched:

                    // will search in SearchTitle, SearchText, SearchSummary, SearchAttachment

                    // will search in all fields

                    // same as UnifiedSearchFor(), but with additional fields
                    .InField(x => x.SearchCategories)
                    .InField(x => ((ArticlePage)x).SecondaryBody)


Feb 07, 2014 10:31

I guess i could specify fields explicitly. That would always work, but it would be better to exclude.

Like this (we also have some other filters and faceting):

ITypeSearch<ISearchContent> query = _epiFindClient
    .UnifiedSearchFor(searchParams.SearchString, currentLangauge);

EDIT: It seems like no matter what field I specify, it still get hits in the same fields.
Edited, Feb 07, 2014 12:50

I would consider it a best practice to specify the fields, as there are a lot of information in the index, and in most cases you would not like to enable free text search on everything. I can see what you mean though, something like .NotInField(..) would be nice, but that would require some custom code.

However, since you are using .UnifiedSearchFor(..), you should by default only be searching in SearchTitle, SearchText, SearchSummary and SearchAttachment. At least that is the case with the latest version. 

If you still are getting hits on other properties then there must be something else triggering it. Have you implemented a wild card search or something similar?

Feb 07, 2014 13:10
Feb 07, 2014 13:15


                ITypeSearch<ISearchContent> query = _epiFindClient.UnifiedSearch(currentLangauge)


Will search every field, as no fields have been specified.

Try a simple test, and see if that works: 

                ITypeSearch<ISearchContent> query = _epiFindClient.UnifiedSearch(currentLangauge)
                        .InField(x => x.SearchTitle)


Feb 07, 2014 13:26

PS! The "SearchText" field will contain all properties that are marked as "Searchable". You could override this by creating a matching property on the page(s).

    public class ArticlePage : PageData

        public string SearchText
            get { return "Whatever " + this.SearchText(); }




Feb 23, 2014 11:08
* 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.