etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.2k stars 130 forks source link

Searching only in specified fields? #211

Closed one-two-three-four closed 7 years ago

one-two-three-four commented 7 years ago

What I have: watson.register(Hub, fields=("title", "text", "url", "meta",)) What I do: watson.filter(Hub, query) But sometimes I would like to do: watson.filter(Hub.meta, query) to get Hubs with query in only meta.

Any way to achieve this using only Watson, without switching to lower-lever database-dependent search functions?

one-two-three-four commented 7 years ago

Found the perfect answer in here: #29 https://gist.github.com/etianen/060d1fe02d79f9bc39b5

Should have searched better.

etianen commented 7 years ago

Glad you found a solution! :)

On 19 July 2017 at 21:56, one-two-three-four notifications@github.com wrote:

Found the perfect answer in here: #29 https://github.com/etianen/django-watson/issues/29 https://gist.github.com/etianen/060d1fe02d79f9bc39b5

Should have searched better.

— 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/211#issuecomment-316514671, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJFCK35Qva8xJ_YLTCPJgQlfSWGaxq6ks5sPm1rgaJpZM4Ockgt .