Score:1

How to exclude a field from the SOLR search index for a specific content type

no flag

I would like to exclude all body fields from the search index for a specific content type.

Reason: We have an Author content type with a bio in the Body field. However, for searches, we only want the author name to be indexed. We want the body field indexed for all other content.

No Sssweat avatar
ua flag
Unfortunately the UI doesn't provide for that. You'll prob just need to overwrite the [`extractFields`](https://git.drupalcode.org/project/search_api/-/blob/8.x-1.x/src/Utility/FieldsHelper.php#L105) method and add a conditional.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.