search for: parse_query

Displaying 20 results from an estimated 72 matches for "parse_query".

2009 Jan 10
2
QueryParser::parse_query() uses OR by default? How to switch to AND?
I use the QueryParser::parse_query() method but I see it uses "OR" by default between words? Is there a way to make it use "AND" instead? I see there are flags I can pass to the parse_query() method but none seems to allow a switch from OR to AND. I would like to do that without having to write my own query p...
2009 Jul 08
1
php error parse_query
I'm having trouble getting a search via php working, I get the following error: *Fatal error*: No matching function for overloaded 'QueryParser_parse_query' in */usr/local/share/php5/xapian.php* on line *1409 *The error occurs at this code $query = $qp->parse_query( $query_string , XapianQueryParser::FLAG_PHRASE | XapianQueryParser::FLAG_BOOLEAN | XapianQueryParser::FLAG_LOVEHATE...
2007 Feb 22
1
Wildcards
Hello, Thanks Olly , by following to your suggestion I could do the indexing in the CSV file while the search results retrieved from the Postgres and it's working fine. [ I am using the Xapian PHP-binding to index and search.] How could I enable the WILDCARDS in it ? I followed with the online manual which says it is disabled by default there given some method to enable but I am not
2006 Dec 06
1
Bug and patch for +terms with wildcards
...TURN(pl); + } } Assert(false); RETURN(NULL); Index: tests/queryparsertest.cc =================================================================== --- tests/queryparsertest.cc (revision 7552) +++ tests/queryparsertest.cc (working copy) @@ -655,7 +655,7 @@ qobj = queryparser.parse_query("muscle*", Xapian::QueryParser::FLAG_WILDCARD); TEST_EQUAL(qobj.get_description(), "Xapian::Query((muscle:(pos=1) OR musclebound:(pos=1)))"); qobj = queryparser.parse_query("meat*", Xapian::QueryParser::FLAG_WILDCARD); - TEST_EQUAL(qobj.get_description(),...
2010 Mar 31
1
Hyphen search with parse_query()
...rips with it. When I do this:: qp = xapian.QueryParser() stemmer = xapian.Stem("english") qp.set_stemmer(stemmer) qp.set_database(database) qp.set_stemming_strategy(xapian.QueryParser.STEM_SOME) print "Query string is:", repr(query_string) query = qp.parse_query(query_string) print "Parsed query is: %s" % str(query) I get the following output:: Query string is: 'peter-bengtsson' Parsed query is: Xapian::Query((ssh:(pos=1) PHRASE 2 bengtsson:(pos=2))) 22 results found. This is wrong as I know I only have one document with the...
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)' >>> str(qp.parse_query('subject:"not&quot...
2011 Sep 23
2
understanding stemming and synonyms
I am working with version 1.2.7 and want to use stemming and synonyms. I use the perl-bindings and get some problems. First of all: the perl-bindings dont allow the QueryParser a third argument when calling parse_query! So i cannot set a default prefix (which perhaps is the solution to my problem, but later more) i have a simple testcase: 3 documents, every document only has one word: bike fahrrad (german bike singular) fahrraeder (german bike plural, umlaut replaced) i have build the database with one synon...
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
2011 Jul 27
3
Searching using prefixes
...ments, with fields: title, subtitle, summary and table of contents o By default, we pass these fields into the TermGenerator::index_text function to generate terms and add these to a Xapian::Document, applying a weighting where required o We then search these fields using XapianQueryParser::parse_query o This gives a result which searches all of the fields for the required string I'd like to add the ability to search JUST one on the fields (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 TermGene...
2018 Sep 30
1
xapian parser bug?
On Sun, Sep 30, 2018 at 09:05:25AM -0300, David Bremner wrote: > if (str.find (' ') != std::string::npos) > query_str = '"' + str + '"'; > else > query_str = str; > > return parser.parse_query (query_str, NOTMUCH_QUERY_PARSER_FLAGS, term_prefix); I wouldn't recommend trying to generate strings to feed to QueryParser like this code seems to be doing. QueryParser aims to parse input from humans not machines. As well as the case where str is an operation name, the code above looks li...
2010 Oct 28
1
hypens in words + NEAR + 3 terms + AND_MAYBE => crash
...earch::Xapian::Stem->new("english"); $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...
2018 Sep 30
3
xapian parser bug?
On Sun, Sep 30, 2018 at 09:50:30AM +0100, James Aylett wrote: > Note that I'm using 1.4.7, and from your output I believe you're not > (the * in the query description I believe doesn't happen in those > situations any more). 1.4.4 and later eliminate redundant 0 scaling factors, but this one isn't actually redundant: > > Query(((Tmail AND 0 * XSUBJECTnot at 1)
2008 Sep 16
0
[PATCH] Add set_max_wildcard_expansion method to the queryparser.
...ryParser.xs +++ b/search-xapian/XS/QueryParser.xs @@ -49,6 +49,12 @@ QueryParser::set_database(database) CODE: THIS->set_database(*database); +void +QueryParser::set_max_wildcard_expansion(max) + long max + CODE: + THIS->set_max_wildcard_expansion(max); + Query * QueryParser::parse_query(q, flags = 7) string q diff --git a/search-xapian/Xapian/QueryParser.pm b/search-xapian/Xapian/QueryParser.pm index f48a12e..3778be3 100644 --- a/search-xapian/Xapian/QueryParser.pm +++ b/search-xapian/Xapian/QueryParser.pm @@ -150,6 +150,13 @@ prefix The term prefix to map this to Returns...
2009 Nov 15
1
setting ValueRangeProcessor at runtime
...I tried just a simple test to see if I could add 5 VPs in a loop. Xapian::QueryParser qparser; Xapian::Query query; int vp = 0; while(vp < 5) { Xapian::StringValueRangeProcessor sproc(vp++); qparser.add_valuerangeprocessor(&sproc); } query = qparser.parse_query(myquery); That will compile, but when that code executes I get this error: pure virtual method called terminate called without an active exception Abort trap I *think* what's happening is that the sproc object goes out of scope at the end of the while() loop and is GC'd by the time the...
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),
2010 Feb 01
0
Solaris core dump
...SpellingTable::open_termlist (this=0x75ed70, word=@0xfdcf8998) at backends/flint/flint_spelling.h:46 #5 0xfe20dcb0 in Xapian::Database::get_spelling_suggestion (this=0x75b5a8, word=@0xfdcf8998, max_edit_distance=2) at include/xapian/base.h:476 #6 0xfe39ba90 in Xapian::QueryParser::Internal::parse_query (this=0x75b590, qs=@0x798288, flags=128, default_prefix=@0xfdcf8a44) at queryparser/queryparser.lemony:948 #7 0xfe38fa0c in Xapian::QueryParser::parse_query (this=0x798218, query_string=@0x798288, flags=128, default_prefix=@0xfdcf8be0) at include/xapian/base.h:154 #8 0xfe5551f0 in _wr...
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() << "'" << endl; ----------------------Code end--...
2011 Jul 14
1
'phrase' default-op mixed with hyphenated words
...Unimplemented Error if the query contains hyphenated words or other terms that implicitly generate a phrase. This can be shown with the following Python extract: >>> from xapian import * >>> qp = QueryParser() >>> qp.set_default_op(Query.OP_PHRASE) >>> print qp.parse_query('John Smith-Jones') Traceback (most recent call last): File "<stdin>", line 1, in <module> xapian.UnimplementedError: Can't use NEAR/PHRASE with a subexpression containing NEAR or PHRASE I'm using the latest release (1.2.6). Are there any plans to implement...
2012 Oct 04
1
Auto completion using xapian
Hello, Do xapian has analyzer like EdgeNGram to use it for autocomplete. I am trying to use the auto completion using xapian. For example: e ex exa exam example etc.. so that we can get it. I tried to use using the Partial flag but it dose not work Xapian::Query query = parser.parse_query("m*",parser.FLAG_PARTIAL); Do you have any example or any tutorial is appreciated. --Naveen. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20121004/df278cfc/attachment.html>
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...