Displaying 5 results from an estimated 5 matches for "flag_default".
2018 Sep 30
0
xapian parser bug?
...iour I see what QueryParser alone, unless you're driving it in a way I don't expect. In python:
>>> import xapian
>>> qp = xapian.QueryParser()
>>> qp.add_prefix('subject', 'S')
>>> str(qp.parse_query('subject:"and"', qp.FLAG_DEFAULT|qp.FLAG_BOOLEAN_ANY_CASE))
'Query(Sand at 1)'
>>> str(qp.parse_query('subject:"or"', qp.FLAG_DEFAULT|qp.FLAG_BOOLEAN_ANY_CASE))
'Query(Sor at 1)'
>>> str(qp.parse_query('subject:"not"', qp.FLAG_DEFAULT|qp.FLAG_BOOLEAN_ANY_CASE))...
2018 Sep 29
2
xapian parser bug?
Today we noticed that keywords can't be searched as prefixed terms. Or
that's what it looks like anyway. I tested and, or, and not.
╰─% NOTMUCH_DEBUG_QUERY=y notmuch search 'subject:"and"'
Query string is:
subject:"and"
notmuch search: A Xapian exception occurred
A Xapian exception occurred parsing query: Syntax: <expression> AND <expression>
Query
2018 Aug 09
0
Boosted fields search in Python
...the queryparser (stemming, for instance).
# See the getting started guide for a complete example.
# ...
# S = Subject. Note that you can't use a keyword argument for default_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....
2010 Oct 28
1
hypens in words + NEAR + 3 terms + AND_MAYBE => crash
...uot;);
$qp->set_stemmer($stemmer);
$qp->set_database($database);
$qp->set_stemming_strategy(STEM_SOME);
$qp->set_default_op(OP_AND_MAYBE);
$query_string = " x-y NEAR test NEAR test ";
my $query = $qp->parse_query($query_string, Search::Xapian::FLAG_DEFAULT);
[...]
Here's a gdb backtrace for a crash:
Program received signal SIGSEGV, Segmentation fault.
~TermGroup (yypParser=0x2b58170, yymajor=<value optimized out>,
yypminor=0x386a7f8) at queryparser/queryparser.lemony:1265
1265 delete *i;
Current language: auto; curren...
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),