drf-haystack
drf-haystack copied to clipboard
Add filters to nested property
Is it possible to add filters to nested SearchFields?
For example: the following SearchField:
class DocumentField(SearchField):
field_type = 'nested'
properties = {
'letters_count': {'type': 'integer'},
}
Is used in this index:
from .search_fields import DocumentField
class TutorialIndex(indexes.SearchIndex, indexes.Indexable):
document = DocumentField(stored=True)
but when I search: /search/?document__letters_count__gte=1000
- I get no results when there are definitely documents within the index that have a letter count greater than 1000.
Hey, I'm afraid that's not possible at the moment. I don't really see that I'll have time implementing this in the near future as I have very limited time working on this library these days. However I'm always willing to accept PRs with new functionality :)