search for: xapianquery

Displaying 15 results from an estimated 15 matches for "xapianquery".

2016 Mar 27
2
PHP5 - Query Parsing Bug
...y-parsing-bug So not sure if that's going to end up being more or less readable... I have this error : Fatal error: No matching function for overloaded 'new_Query' in /usr/share/php/xapian.php on line 2607 Line 2607 (and surrounding) looks like this and are in the __construct() of XapianQuery (with better indentation): """ switch (func_num_args()) { case 0: $this->_cPtr=new_Query(); break; case 1: $this->_cPtr=new_Query($copyme_or_tname__or_op__or_external_source_or_op); break; case 2: $this->_cPtr=new_Query($copyme_or_tnam...
2011 May 23
1
More relevance for recent documents
...ording to the date, I still prefer relevance, but I would like to see recent documents with better scoring. I was trying to add search query using AND_MAYBE, which should use relevance from both subqueries, but it didnt add any benefit to the resalts which are match by this subquery $query = new XapianQuery(XapianQuery::OP_AND_MAYBE, $query, new XapianQuery(XapianQuery::OP_VALUE_GE, self::DATE, date('Ymd000000', strtotime("- 1 year")))); Is there some way how to give more relevance to the recent documents? Would be solution possible in PHP where is still some problem with subclasin...
2016 Mar 27
0
PHP5 - Query Parsing Bug
...rsing-bug It's a fairly safe bet that if you search for an error message and find a 9 year old message which says it's been fixed, you aren't hitting the same issue, but rather a different issue which gives the same error message. > The error appear when trying to instanciate a new XapianQuery object > with a query element: > > new XapianQuery($subquery); Their function doccomment says $extra is an array of arrays, so $subquery is an array. But the code fails to say what operator to use to combine the elements in that array, so the error you're getting seems correct to...
2015 May 04
2
Make Xapian accept all characters
...ose ( > > http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html ) > > QueryParser doesn't currently allow controlling the characters which > make up a word, but you can just construct a Query object directly > for any term you want: > > $hashquery = new XapianQuery('##'); > > Cheers, > Olly
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...
2015 May 03
2
Make Xapian accept all characters
Hello everyone, I'm using Xapian at work (PHP bindings) and I have to make it accept '##' as a term to index. We have a layer on top of xapian, but as far as I can tell, Xapian's QueryParser is removing them from the query. So, if I search for just '##' I get an empty query, after Xapian parsed it. I've seen the flags this class accepts, but I can't do what I want
2007 Feb 09
1
PHP Binding and dbi2omega questions
...he php xapian bindings like so: <?php include "xapian.php"; // Open our xapian database $db = Xapian::auto_open('/usr/local/lib/omega/data/default'); $enq = new XapianEnquire($db); // Query for "php" or "mysql" $enq->set_query(new XapianQuery(XapianQuery::OP_OR, "php", "mysql")); // lets grab the matches! $mset = $enq->get_mset(0, 10); // output how many estimated echo 'Matches: '.$mset->get_matches_estimated().'<br/>'; // Output the terms that matched $terms = join...
2010 Oct 21
2
In-memory databases vs PHP Bindings
...how to create an in-memory database via the PHP bindings. Here's what I've got so far, using a disk-based index with an automatic backend (third line from the end is the critical one): // Find the document in the posts index $xenq = new XapianEnquire($xdb_posts); $xenq->set_query(new XapianQuery("UIDpost".$postid)); $xdoc = $xenq->get_mset(0, 1)->begin()->get_document(); // Create a database that just contains the one document // TODO:AB:20101020: Work out how to build an in-memory Xapian database via PHP bindings $xdb_doc = new XapianWritableDatabase(PROJROOT.'/tm...
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
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
2015 May 04
0
Make Xapian accept all characters
...n't do what > I want with those ( > http://xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html ) QueryParser doesn't currently allow controlling the characters which make up a word, but you can just construct a Query object directly for any term you want: $hashquery = new XapianQuery('##'); 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:(p...
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
2006 May 17
3
QueryParser lowercase / uppercase and stemming
...terms are not stemmed, although a stemmer is 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...