amschaal / submissions

1 stars 0 forks source link

Make JSONField data searchable #123

Closed amschaal closed 1 year ago

amschaal commented 1 year ago

To start with, try using Django JSONField's querying functionality. Available queries should be generated based on submission type schemas. Perhaps schemas should have an attribute of "searchable".

If JSONField querying is too limited or not performant, consider using Apache SOLR or similar to index/search JSONField.

amschaal commented 1 year ago

Per lab, create a library of available queries, potentially based on "searchable" attribute. Should generate a list of query params which can be searched in UI, something like: { 'commentsicontains': {'fieldname': 'comments', 'types': ['text'], submission_types: [{'id': 1, 'name': 'Example type'},...] , 'samples__sample_namecontains: {'fieldname': 'sample_name', 'types': ['text'], submission_types: [{'id': 1, 'name': 'Example type'},...] , 'type__contains: {'fieldname': 'type', 'types': ['text'], 'enum': ['option1', 'option2'], submission_types: [{'id': 1, 'name': 'Example type'},...] ,

amschaal commented 1 year ago

This has been working well using postgres's built in JSONB field functionality. At this point, the feature can be considered added, even if maybe it isn't as powerful as using a separately indexed search engine.