Displaying 18 results from an estimated 18 matches for "add_prefix".
2013 Sep 02
2
having trouble with prefixes
...t returns the document using
any of the terms. Here is the outline of the code that runs the queries
I'm trying to run:
Database db(db_path.string());
QueryParser queryparser;
Stem stemmer("english");
//queryparser.set_stemmer(stemmer);
queryparser.set_database(db);
queryparser.add_prefix("type", "T");
queryparser.add_prefix("md5sum", "Q");
queryparser.add_prefix("path", "P");
queryparser.add_prefix("extension", "E");
//maybe set stemming strategy here (in query parser)?
queryparser.set_stemming_str...
2007 Oct 19
1
Re: [Xapian-commits] 9476: trunk/xapian-core/ trunk/xapian-core/include/xapian/ trunk/xapian-core/queryparser/ trunk/xapian-core/tests/
...9476
> Date: 2007-10-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 upda...
2007 Nov 09
1
Query Parser add_prefix for Java
How I can make the search using prefix in java?, not have implemented
yet in the binding? I have the 1.0.4
2009 Dec 13
1
Combined search in multiple fields help
Hello,
I want to let user specify by drop down list to what fields his query will be searched. For example "Full-text" or "Title+Author", then user enters search query as usual (without using prefixes). But how to modify query so it cover two fields in a right way?
For a starter how I think about modifying query to limit it just to single globally selected field:
1. after
2018 Jul 19
1
choosing between probabilistic and boolean prefixes for terms
Hi all,
public-inbox allows searching for git blob names (e.g. "badc0ffee")
in patches. Initially, I chose to use add_prefix for probabilistic
terms, since I assumed it could be a superset of what boolean
searching offered. Unfortunately, it doesn't seem to be the case
because stemming is interfering.
So switching to boolean filtering seems to work; and it is
fine for mechanical searches I plan on doing:
https:/...
2011 Jul 27
3
Searching using prefixes
...(title, in
this case) so according to the API documentation, here's what I
understand I need to do:
o When creating the index, call TermGenerator::index_text with the
prefix 'S' (i.e. index_text('some text', 150, 'S')
o When querying the index, call QueryParser.add_prefix('', 'S')
before calling parse_query with the string I want to use
However, the documentation is a little unclear as to how this actually
works - specifically, how I do a search for multiple words in just the
title. For example, I have a title: "Research into Cheese in China&qu...
2010 Nov 02
1
How to make QueryParser select entire word like "H.O.T"
Hi,
I'm using xapian to build my search engine, but met with a problem.
The code snippet is like:
----------------------Code begin-------------------------------------------------------------
Xapian::QueryParser qp;
qp.add_prefix("Singer", "S");
Xapian::Query query = qp.parse_query("Singer:s.h.e", Xapian::QueryParser::FLAG_PARTIAL|Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS |Xapian::QueryParser::FLAG_PHRASE );
cout << "Performing query `" << query.get_description() &...
2010 Jan 19
1
QueryParser: aliases and OP_AND
...er parses a query containing an "alias" when the default operator is OP_AND
(by "alias", I mean a search field mapped to multiple term prefixes).
With the following php code :
<?php
$parser=new XapianQueryParser();
$parser->set_default_op(XapianQuery::OP_AND);
$parser->add_prefix('alias', 'AUT1:');
$parser->add_prefix('alias', 'AUT2:');
echo $parser->parse_query('alias:(john smith)')->get_description();
?>
I get:
Xapian::Query(((AUT1:john:(pos=1) OR AUT2:john:(pos=1)) AND (AUT1:smith:(pos=2) OR AUT2:smith:(pos=2))))
i.e....
2013 Sep 22
2
How to filter search result with query with has white space.
...){
try{
Xapian::Database db("/Users/ramesh/Desktop/xapian");
Xapian::Enquire enquire(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(q...
2013 Sep 22
2
How to filter search result with query with has white space.
...){
try{
Xapian::Database db("/Users/ramesh/Desktop/xapian");
Xapian::Enquire enquire(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(q...
2015 Dec 28
3
synonym expansion for boolean prefixes.
...ibed to the list.
######################################################################
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: signatu...
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
2018 Sep 30
0
xapian parser bug?
David — this isn't the behaviour 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)&...
2008 Sep 16
0
[PATCH] Add set_max_wildcard_expansion method to the queryparser.
...ndex 88cbb8f..87cfaf5 100644
--- a/xapian-core/queryparser/queryparser_internal.h
+++ b/xapian-core/queryparser/queryparser_internal.h
@@ -74,6 +74,8 @@ class QueryParser::Internal : public Xapian::Internal::RefCntBase {
string corrected_query;
+ long max_wildcard_expansion;
+
void add_prefix(const string &field, const string &prefix, bool filter);
std::string parse_term(Utf8Iterator &it, const Utf8Iterator &end,
@@ -81,7 +83,7 @@ class QueryParser::Internal : public Xapian::Internal::RefCntBase {
public:
Internal() : stem_action(STEM_NONE), stopper(NULL...
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
2012 Jan 05
1
Enhance synonyms feature of the query parser (patch included)
...t contain any prefix info in synonym table except that 'Z'.
For example, I have the following synonyms and prefix info:
db.add_synonym("search", "find");
db.add_synonym("Zsearch", "Zfind");
db.add_synonym("foo bar", "foobar");
qp.add_prefix("title", "T");
I think my expected results of query parser should be like this:
"search something" ==> "(Zsearch:(pos=1) SYNONYM find:(pos=1)) AND Zsometh:(pos=2)
"title:search" ==> "ZTsearch:(pos=1) SYNONYM Tfind:(pos=1)"
"title:s...
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
2007 Nov 08
1
QueryParser : some remarks
...;
operators are not recognized anymore b) the mset contains lucene
documents ;-)
- tit:xapian not lucene) -> Tit=xapian OR not OR lucene
another variant of unmached brackets, same results
- tit:(xapian -> title OR xapian
(assuming that 'tit' is an existing prefix added via
qp->add_prefix('tit', 'xxx'))
Unmatched brackets again, this time, this is the field name which is not
recognized anymore, resulting in an empty mset.
Once again, I would prefer a 'bad query' exception.
- something:xapian -> something PHRASE 2 xapian
(assuming that 'something'...