-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API] Set up "Dynamic" Search for api/v1/resources/
#22
Comments
There is an additional twist for this now that we are using a generic relation for Tags through taggit. Django-filter (not sure this will help - needs more investigation) |
api/v1/resources/
api/v1/resources/
Going to try and take a shot at this at some point soon, but would welcome some collaborators. |
Am I right in understanding that the aim of this is to allow the user to specify which fields they'd like their search query matched against as part of the search request and that without this the default is to search all fields? |
That is correct. The current implementation is a "default" implementation of the DRF Filter Backend, which really does nothing more than filter the So searching is a simple "includes" match against the content in all fields in the resources model. The twist is that although Implementing dynamic search would attempt to do two things:
But (as noted in issue #73) number 2 might need to be part of an overall strategy for a |
Correction. We are using the DRF SearchFilter Backend - but functionally, it more or less has the same effect. Yes - we can control which fields the search runs against, but it is not a very intelligent search - and we cannot currently include tags as part of the search fields. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Putting this on hold for a bit while we thin through hangouts and tagging and weather or not we will be using something like haystack or something else. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Currently,
api/v1/resources/
usesfilters.SearchFilter
as its filter_backend. This particular filter does a search on all fields for the requested parameters, which is not granular enough for our search needs.As in this article: https://medium.com/better-programming/how-to-make-search-fields-dynamic-in-django-rest-framework-72922bfa1543? we need to make this api endpoint more dynamically searchable by implementing a custom filter_backend.
The text was updated successfully, but these errors were encountered: