Displaying 11 results from an estimated 11 matches for "add_boolean_prefix".
2007 Oct 19
1
Re: [Xapian-commits] 9476: trunk/xapian-core/ trunk/xapian-core/include/xapian/ trunk/xapian-core/queryparser/ trunk/xapian-core/tests/
...0-19 03:47:11 +0100 (Fri, 19 Oct 2007)
>
> Log message (14 lines):
> include/xapian/queryparser.h,queryparser/queryparser.cc,
> queryparser/queryparser.lemony,queryparser/queryparser_internal.h,
> tests/queryparsertest.cc: Since calling QueryParser::add_prefix()
> or QueryParser::add_boolean_prefix() a second time with the same
> field name was ignored before (rather than overriding as we had
> thought) it seems reasonable to change this behaviour. This
> also avoids the need to deprecate these methods which will force all
> users to update their code.
I think leaving the old me...
2006 Oct 30
1
QueryParser and prefixes
...My app uses prefixes for user-defined labels and directory names.
Since these are
case-sensitive, I chose XLABEL and XDIR respectively. Labels and directories
may start with an upper-case, so a ":" is always inserted between the
prefix and the
term itself. These prefixes are mapped with add_boolean_prefix to
"dir" and "label".
Let's imagine I index a document with "XLABEL:xapian". Running 'delve' on the
index afterwards confirms the term is there.
Now, if I pass "label:xapian" to the QueryParser, no results are
returned. It turns
out that the Quer...
2017 Jan 04
0
Formulating Advanced Queries with Xapian-Omega
...me:
while ($text =~ /(\b\d-\d{3}-\d{5}-[\dX]\b)/g) {
$doc->add_boolean_term("XISBN$1");
}
With this approach, you could also easily do additional validation (such
as checking the check digit for codes which have one, as ISBNs do).
Then at query time:
$queryparser->add_boolean_prefix("isbn", "XISBN");
Then the user can use isbn:1-234-56789-0 to filter only documents
mentioning that ISBN. Or if you want to be able to find documents
which mention any ISBN (or anything which looks like one) then:
if ($text =~ /(\b\d-\d{3}-\d{5}-[\dX]\b)/) {
$doc->ad...
2015 Dec 28
3
synonym expansion for boolean prefixes.
....
######################################################################
import xapian
db=xapian.WritableDatabase("db",xapian.DB_CREATE_OR_OPEN)
db.add_synonym("Kfoo","Kbar")
db.commit();
qp = xapian.QueryParser()
qp.set_database(db);
# replacing add_prefix with add_boolean_prefix stops synonym expansion, tested with 1.2.21
qp.add_prefix("tag","K")
query=qp.parse_query("tag:foo",xapian.QueryParser.FLAG_AUTO_SYNONYMS)
print query;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application...
2016 Dec 29
2
Formulating Advanced Queries with Xapian-Omega
To Olly Betts:
Thank you very much for any feedback.
I apologise for this belated reply and also for the fact that the text
of the previous posting appeared fragmented, due to its fixed
chars/line format.
With reference to:
> Can, or could, one construct a query so that Omega (Xapian) can
handle
> this ?
>
> ... perhaps with some type of Regex ?
>
> It would seem
2013 Feb 21
1
Parsing fields with phrases.
I have the following code:
my $par =
$qp->parse_query($query,Search::Xapian::FLAG_SPELLING_CORRECTION);
print LOG "Query $query, par $par\n";
my $enq = $xDatabase->enquire( $par );
The output from the LOG file is:
Query title:"new dolphin", par Xapian::Query(0 * Snew dolphin)
No results are returned. If I change the search to title:dolphin it
finds a
2016 Jan 05
0
synonym expansion for boolean prefixes.
...he it gets passed the value and returns a Query object
for it. E.g. in lua (where you can just pass an anon function for the
FieldProcessor - we ought to support C++11 lambdas for such things):
require "xapian"
foo_tag_term = "Kbar"
qp = xapian.QueryParser()
qp:add_boolean_prefix("tag",
function (x)
if x == "foo" then
return xapian.Query(foo_tag_term)
end
return xapian.Query("K" .. x)
end)
print(qp:parse_query("tag:foo tag:x"))
Which parses to give:
Query(0 * (Kbar OR Kx))
To achieve this with synonyms...
2013 Sep 22
2
How to filter search result with query with has white space.
...re(db);
Xapian::QueryParser qp;
Xapian::Stem stemmer("english");
qp.set_default_op(Xapian::Query::OP_FILTER);
qp.set_stemmer(stemmer);
qp.add_prefix("","title");
qp.add_prefix("","content");
qp.add_boolean_prefix("title","title");
qp.set_database(db);
qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
Xapian::Query query = qp.parse_query(query_string);
std::cout << "Parsed query is: " << query.get_description() <<
std::en...
2013 Sep 22
2
How to filter search result with query with has white space.
...re(db);
Xapian::QueryParser qp;
Xapian::Stem stemmer("english");
qp.set_default_op(Xapian::Query::OP_FILTER);
qp.set_stemmer(stemmer);
qp.add_prefix("","title");
qp.add_prefix("","content");
qp.add_boolean_prefix("title","title");
qp.set_database(db);
qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
Xapian::Query query = qp.parse_query(query_string);
std::cout << "Parsed query is: " << query.get_description() <<
std::en...
2006 Nov 30
1
PHP / XapianQueryParser
...o use the XapianQueryParser (in PHP5), but I get an error everytime.
$odb = new XapianDatabase($db);
$ostem = new XapianStem("en");
$oqparser = new XapianQueryParser();$oqparser->set_stemmer($ostem);$oqparser->set_database($odb);$oqparser->set_stemming_strategy(1);$oqparser->add_boolean_prefix("Q",1);$oquery = $oqparser->parse_query($query, 1);
I found some perl examples and 'ported' it over to the PHP version. Varying the flags (like XapianQueryParser::FLAG_PHRASE) or the boolean_prefix, etc. does not influence anything. I tried to lcoate the error in Xapian.php,...
2007 Sep 24
5
Deprecation policy question
Olly and I have been discussing details of our policy for deprecating
features, and we thought it would be useful to canvas users opinions on
a particular aspect.
From time to time, we remove features from the library (usually because
we have a better replacement). To make life easier for users, we've
been following a deprecation policy, so that users are given plenty of
warning of