0

I need to filter documents by two fields name and address. I need to get results with names contains 'mar' first and then results with addresses contains 'mar'. But I'm getting randomly filtered results. Like:

(name:(mar))^20 OR address:(mar)

Results from this query all documents are randomly sorted. If some type of sorting exists, I'll appreciate your help. Thanks.

EDIT: Boost in query working, and problem not with boost but with sorting. I have third field priority and when I provide additional fq priority asc boosting don't affect result.

wowbrowser search
  • 345
  • 1
  • 3
  • 11

1 Answers1

0

I've understood my mistake. I need results with names contains 'mar' as first and then with addresses contains 'mar', and after it I needed just to order by priority asc, and after it order by score desc to get correct results. Now i just need to implement it with Django Haystack.

wowbrowser search
  • 345
  • 1
  • 3
  • 11