NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

add searchable names function to data_models #427

Open CarsonDavis opened 1 year ago

CarsonDavis commented 1 year ago

Most models have a variety of possible names which can refer to an object. short_name, long_name, aliases, etc. A user desiring to search for a campaign based on a string will expect to see a result that is matched against any of the valid name fields.

This PR implements a list of possible valid name fields for each model and updates the search function to use these fields in the default search.

PROBLEMS: Currently, the list of returned results in the queryset is not unique, and adding a .distinct('uuid') constraint seems to massively slow down the application.