django-watson
django-watson copied to clipboard
expose metadata also in .filter() results
Currently when using .search()
you can access the metadata of each searchresult using result.meta['xxxx']
or result.meta.xxxx
.
When using .filter()
on en existing queryset, this metadata is not exposed. Would be helpful to access the metadata here as it could contain data not available in the queryset models or the result of some expensive calculation performed during indexing.
I don't think this is possible. If you want the metadata, why not use search()?
On Tue, 15 Sep 2020 at 14:39, valentijnscholten [email protected] wrote:
Currently when using .search() you can access the metadata of each searchresult using result.meta['xxxx'] or result.meta.xxxx.
When using .filter() on en existing queryset, this metadata is not exposed. Would be helpful to access the metadata here as it could contain data not available in the queryset models or the result of some expensive calculation performed during indexing.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/etianen/django-watson/issues/279, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEKCCGGU6RIZ536DOH6GDSF5U7BANCNFSM4RNE2SOQ .
the watson_rank
is exposed, so meta could be exposed to (as dictionary)?
I need to perform some filtering and prefetching before performing the full text search.
The metadata is saved as a json-encoded blob. It could possibly be attached to the model using ".annotate()", but it would be attached as a string, rather than a dictionary. I can't see a way to improve on this.
On Tue, 15 Sep 2020 at 18:03, valentijnscholten [email protected] wrote:
the watson_rank is exposed, so meta could be exposed to (as dictionary)?
I need to perform some filtering and prefetching before performing the full text search.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/etianen/django-watson/issues/279#issuecomment-692847737, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEKCG6H6VGCOFRHT5YMGDSF6M5ZANCNFSM4RNE2SOQ .