Skip to content

Use class name as search query source

Refs https://redmine.teklia.com/issues/9604

The endpoint SearchCorpus needs to expose a new source as classification. A user should be able to search amongst the indexed class names. You'll nead to update CorpusSearch.build_solr_query but also update the Indexer.build_classifications so it has an extra classification_text field which is simply the the classification.ml_class.name.

You can test using the client data - importing the sqlite export through load_export, then running reindex command on the corpus.

Expected results: when the query has the classification and element sources enabled, the same term must be searched across both element names & classifications class names.