IPublishedContentQuery Search in Umbraco 13

Hi,

Is there a way to stop Examiner searching specific fields we where testing a search we created on one of our client sites and we set it to use “ ExternalIndex “ but form some reason it pulling back author and editor names as part of the search and not just searching page content.

public List genericSearch(string searchQuery)
{
//InternalIndex
//ExternalIndex
List results = _publishedContentQuery.Search(searchQuery,“*”, “ExternalIndex”).ToList();
return results;
}

Can any one suggest any changes to the code so that it just dose content not author, editor ect.

A PublishedContentQuery searches on all fields in the index. Umbraco by default adds certain data that is not part of the implementor defined content into the index for common usecases

I would advice you to either use a custom index with just the fields you define

Or use a custom query on the external index for just the fields you want