Displaying 2 results from an estimated 2 matches for "weighted_title_query".
2018 Aug 09
0
Boosted fields search in Python
...ult_prefix, so we have
# to provide the flags as well.
title_query = queryparser.parse_query(querystring, xapian.QueryParser.FLAG_DEFAULT, "S")
Then you need to use OP_SCALE_WEIGHT, as you've identified, to apply the different weightings to the queries parsed against the two fields.
weighted_title_query = xapian.Query(xapian.Query.OP_SCALE_WEIGHT, title_query, 4)
Finally you need to combine the two weighted queries. You can do this using OP_OR, which will rank higher a document where both the title and the body match. Alternatively, OP_MAX may work better (use whichever side ranks higher, which w...
2018 Aug 09
2
Boosted fields search in Python
Hi,
I'm using Xapian in Python2. I'm trying to replicate an analysis that
somebody else performed in Lucene. To do that I need to do a search for a
multi-word query in which particular fields are boosted - preferably at
query time. That is, given a query like "the cat is lying on the mat" (with
an OR operator, ignoring word positions but with stemming and stop words
removed),