search for: xapianenquir

Displaying 8 results from an estimated 8 matches for "xapianenquir".

Did you mean: xapianenquire
2012 Feb 17
2
DatabaseModifiedError on get_data - best practice?
Hi, I have previously had a problem with getting this error on a get_mset call, and solved it by subclassing XapianEnquire with a backoff-and-retry algorithm (as suggested by this list, many thanks!). However, I now get it intermittently when calling get_data on a XapianDocument. The same solution doesn't seem to be quite as easy in this case, because: 1. The document is not instantiated by my code, it's re...
2010 Oct 21
2
In-memory databases vs PHP Bindings
...hes their search). However, I can't work out 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_...
2006 May 17
3
QueryParser lowercase / uppercase and stemming
...xapian wrapper written by Daniel M?nard I build a query using parseQuery. Output of the parsed query shows that 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($ste...
2009 Mar 02
0
Xapian, PHP bindings and
...'xapian.class.php' ); require_once( 'xapianencode.func.php' ); // Open the database for searching. try { $database = new XapianDatabase( $_PATH.'/_inc/cache/xapian/pa' ); // Start an enquire session. $enquire = new XapianEnquire($database); // Combine the rest of the command line arguments with spaces between // them, so that simple queries don't have to be quoted at the shell // level. $query_string = xapianEncode( $_GET['q'...
2009 Aug 17
1
Xapian DatabaseError
...simpleSearch($query,"xapian_db"); --> 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);...
2011 Jun 10
2
Just starting to experiment with php
...e: include "/usr/share/php/xapian.php"; if ($argc < 3) { print "Usage: {$argv[0]} PATH_TO_DATABASE QUERY\n"; exit(1); } // Open the database for searching. try { $database = new XapianDatabase($argv[1]); // Start an enquire session. $enquire = new XapianEnquire($database); ... What did I miss?
2007 Feb 09
1
PHP Binding and dbi2omega questions
...e=50 field=content ============================= However, when querying the xapian database using the 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->g...
2006 Nov 30
1
PHP / XapianQueryParser
...unhtml weight=4 index field=content This is the format for scriptindex. When I search my code with <?include "xapian.php";$db = "db/sitedb"; $odb = new XapianDatabase($db);$ostem = new XapianStem("en");$oquery = new XapianQuery("visual");$oenquire = new XapianEnquire($odb);$oenquire->set_query($oquery);echo "<pre>"; echo "Perform: " . $oquery->get_description() . "<br/>";$omset = $oenquire->get_mset(0, 10); echo "Matches: " . $omset->get_matches_estimated() . "<br/>"; $oiter = new...