Add ability to skip Highlight processor

Created on 24 June 2025, about 2 months ago

Problem/Motivation

Processors apply to an index, but there are instances where it may be helpful for a processor to only be active in certain situations.

For example, recent profiling showed that we had a performance issue with the Highlight processor. This has been reported by another user in Highlighter processor performance issue when fields are missing from search backend Active . But in our case we do not need it active at all for the specific view it was causing an issue for.

Steps to reproduce

In our case, we have 1 index and multiple views. 1 view for a global search (which uses the highlight processors result) and other views which use the index either to search a subset of the content or provide faceted listing pages. These do not use the results of the highlight processor. In our case, it is adding about 200ms to the page.

Proposed resolution

I think the concept of turning a processor from global => opting out could be potentially be very confusing. I'm not sure if a similar use case exists for other processors.

In the Highlight processors case, I wonder if the simplest solution is to have a tag such as search_api_skip_processor_highlight that we could apply to the view. Then in the plugin's postprocessSearchResults method the processor could exit early if the query has this tag?

That would make it a bit of a hidden feature, but I don't think its something that all users are going to be particularly concerned with.

Remaining tasks

  • Agree on approach
  • Implement
  • Test
Feature request
Status

Active

Version

1.0

Component

General code

Created by

🇳🇿New Zealand ericgsmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024