UCL / frrant

2 stars 0 forks source link

Search within specific fragment fields #337

Closed tcouch closed 2 years ago

tcouch commented 2 years ago

closes #317

Provides additional options under the Content Type dropdown to allow users to limit search to specific fields within Fragments, Testimonia, Apposita and Anonymous Fragments:

Changes to views.search.SearchView

A new SearchMethodGroup class uses functools.partial to create new versions of the existing fragment_search, testimonium_search etc. methods for each of the fields that can be searched individually. If a single search_field is passed to original_text_owner_search, it will use that instead of the default set of search fields.

To avoid unnecessary duplication of searches, the single field methods are not run by default (i.e. when no search classes are specified in the get request).

Changes to search_results.html

The Content Types drop down now uses to contain sets of search classes that can be applied to a specific content type.