The current event subscriber has a hard coded ranking/query implementation. It would be ideal to instead call a custom plugin that handles this instead so developers can implement their own ranking/querying because it will vary site to site. The plugin could be a setting at the index level.
The current implementation can serve as the initial plugin, an example:
/**
* Pure vector search ranker.
*/
#[SolrRanker(
id: 'pure_vector',
label: new TranslatableMarkup('Pure Vector'),
)]
class PureVector extends SolrRankerPluginBase {
/**
* {@inheritdoc}
*/
public function applyRanking(SolariumQueryInterface $query, string $solr_field, int $top_k, array $vectors): SolariumQueryInterface {
return $query->setQuery('{!knn f=' . $solr_field . ' topK=' . $top_k . '}[' . implode(', ', $vectors[0]) . ']');
}
}
Active
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.