search for: xapianqueryparser

Displaying 14 results from an estimated 14 matches for "xapianqueryparser".

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 Nov 30
1
PHP / XapianQueryParser
...not even when I 'authorized' the reply. So I'll just paste it here for reference, below this message. It might help some people. But now I have one other small problem, and I'm not sure if it is actually my mistake (although I'm pretty sure it is :)) I'm trying to 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&...
2009 Jul 08
1
php error parse_query
...g 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 | XapianQueryParser::FLAG_SPELLING_CORRECTION ); I also tried $query = $qp->parse_query($query_string); It's really got me scratching my head...
2009 Mar 02
0
Xapian, PHP bindings and
...ments with spaces between // them, so that simple queries don't have to be quoted at the shell // level. $query_string = xapianEncode( $_GET['q'] ); $rset = new XapianRSet(); $qp = new XapianQueryParser(); $stemmer = new XapianStem( 'french' ); $qp->set_stemmer($stemmer); $qp->set_database($database); $qp->set_stemming_strategy(XapianQueryParser::STEM_SOME); $query = $qp->parse_query( $query_st...
2023 Mar 30
1
Having trouble with php8 bindings
...hile trying to update previously-worked-in-php7 code in the actual file I'm trying to update $this->queryparser->set_default_op(Query_OP_AND); ...leads to "Undefined constant "App\Helpers\Query_OP_AND" because... another namespace issue? ("OP_AND" and "XapianQueryParser::OP_AND" are also not accepted.) jh
2009 Aug 17
1
Xapian DatabaseError
...ot;); --> xapian_db is the path where is stored xapian db } 2) This is the code of search function.inc <?php require_once 'xapian.php'; function simpleSearch($query,$path){ try { $database = new XapianDatabase($path); $enquire = new XapianEnquire($database); $qp = new XapianQueryParser(); $stemmer = new XapianStem("italian"); $qp->set_stemmer($stemmer); $qp->set_database($database); $qp->set_stemming_strategy(XapianQueryParser::STEM_SOME); $query = $qp->parse_query($query); echo "<br>Parsed query...
2023 Mar 30
1
Having trouble with php8 bindings
On Thu, Mar 30, 2023 at 04:42:41AM +0100, John Handelaar wrote: > It appears that I can't use anything in PHP8.2 if the PHP file from > which I want to access xapian contains a namespace declaration, > because the PHP functions themselves cannot be found. You need to tell PHP to look in the root namespace, e.g.: $test = new \XapianWritableDatabase('searchdb'); Another
2023 Mar 30
1
Having trouble with php8 bindings
...rked-in-php7 code in the actual file I'm trying to update > > $this->queryparser->set_default_op(Query_OP_AND); > > ...leads to "Undefined constant "App\Helpers\Query_OP_AND" because... > another namespace issue? > > ("OP_AND" and "XapianQueryParser::OP_AND" are also not accepted.) It's `XapianQuery::OP_AND`, which was also the correct name in the PHP7 bindings. Looks like `Query_OP_AND` used to happen to work due to how SWIG implemented PHP7 wrappers, but it isn't what we intended people to be using. Cheers, Olly
2010 Jan 19
1
QueryParser: aliases and OP_AND
Hello, I'm wondering about how the QueryParser 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)...
2007 Jun 11
3
Xapian 1.0.1 released
I've now uploaded Xapian 1.0.1, which you can download from the usual place: http://www.xapian.org/download.php This release mainly comprises bug fixes and performance improvements. The "simple" examples (for both C++ and the bindings) have also been overhauled and now use the QueryParser and TermGenerator classes, which makes for simpler examples and should better reflect
2007 Jun 11
3
Xapian 1.0.1 released
I've now uploaded Xapian 1.0.1, which you can download from the usual place: http://www.xapian.org/download.php This release mainly comprises bug fixes and performance improvements. The "simple" examples (for both C++ and the bindings) have also been overhauled and now use the QueryParser and TermGenerator classes, which makes for simpler examples and should better reflect
2007 Nov 08
1
QueryParser : some remarks
...st a bad spelling if there is no better suggestion? An answer would be to periodically clean the spellings table (hum... can we iterate over them ?) and to re-index all the documents, but it is not very convenient... Any thought? 4. QueryParser tolerance, reporting query errors It seems that XapianQueryParser is very tolerant: if I parse a 'bad' query (e.g. unmatched brackets, unmatched quotes, nonexistent field name...), it will ignore the error and produce a query. I imagine that this is 'by design' and this is probably the best approach for most users, but I have many cases where i...
2011 Jul 27
3
Searching using prefixes
...of a number of documents, 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,...
2006 May 17
3
QueryParser lowercase / uppercase and stemming
...s set ( see code snippet) # create a XapianDatabase object to search in $db = new XapianDatabase($path2db); # every Query needs an XapianEnquire object; i.e. specifying database to search in $enquire = new XapianEnquire($db); # call XapianQuery object $myQueryParser = new XapianQueryParser(); $myQueryParser->setDatabase($db); $stemmer = new XapianStemmer("german"); $myQueryParser->setStemmer($stemmer); $myQueryParser->setStemmingStrategy(STEM_ALL); #$querystring = removeUmlaute($querystring); #wildcard search $myQuery = $myQueryPa...