In T285817: Add an image: load static file to search index a list of pages which have image recommendations have been imported into the search index (as recommendation.image weighted tags) for use by the GrowthExperiments suggested edits feature. Initial versions of the suggested edits code can't handle infoboxes; our plan was to filter these out via additional search terms. Unfortunately we have found (T291232: Add an image: exclude certain articles ) that the number of infobox templates is too large for that, even taking into account that some infobox templates reuse others as building blocks. So unfortunately we need to rethink our approach.
One possible option we'd like to discuss is creating a custom search keyword for whether an article has an infobox. We can generate a list of infobox templates; after filtering out redundancies (where one infobox template is a wrapper around another infobox template), we get a list of 100-200 templates for each of the four wikis where we currently need this feature. That's way too much to include as a hastemplate: query due to search string length limits; is it possible to include as a custom query, or would the high number of templates cause problems internally (like the ElasticSearch query getting too large)?
The idea would be that we list the templates on a JSON wiki page that can be kept up-to-date by the wiki community; the GrowthExperiments extension defines a hasinfobox search keyword, which is translated to a query similar to hastemplate: but instead of taking arguments, it would use the template list from the wiki configuration page. The keyword would then be combined with hasrecommendation:image when searching for pages to suggest edits to.
The other idea we could come up with is T292140: Reimport image recommendation data into search index.