search for: db_create_or_overwrit

Displaying 7 results from an estimated 7 matches for "db_create_or_overwrit".

Did you mean: db_create_or_overwrite
2010 Oct 24
1
Cannot index with dynamic spelling data (Perl/Search::Xapian)
This is my test case, what am I doing wrong? It seems that the API is used incorrectly, but I cannot find the problem... --- 8< --- #!/usr/bin/perl use Search::Xapian qw(:all); use strict; my $xa = new Search::Xapian::WritableDatabase ("/tmp/xapian", DB_CREATE_OR_OVERWRITE); my $indexer = Search::Xapian::TermGenerator->new(); $indexer->set_flags(Search::Xapian::FLAG_SPELLING); my $doc = new Search::Xapian::Document; $indexer->set_document($doc); $indexer->index_text("hello 123 blah blah"); $xa->add_document($doc); --- >8 --- Output:...
2010 Oct 21
2
In-memory databases vs PHP Bindings
...c = $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.'/tmp/xapian/doc'.$postid, Xapian::DB_CREATE_OR_OVERWRITE); $xdb_doc->add_document($xdoc); $xdb_doc->commit(); Also, FYI, the documentation here seems incomplete: http://xapian.org/docs/apidoc/html/classXapian_1_1TermIterator.html I had to inspect the bindings to find the rather useful get_term() method of the TermIterator class! It does menti...
2007 May 15
1
Document ID 0 is invalid... but not always...
...t, I was "hacking", trying to store metadata in a "special" record with docId "-1"... I know, this is bad, but what is interesting is what xapian does in such a situation... Here is a simple PHP test : $db=new XapianWritableDatabase('pathtodb', Xapian::DB_CREATE_OR_OVERWRITE); $doc=new XapianDocument(); $doc->set_data('metadata'); // waiting for http://www.xapian.org/cgi-bin/bugzilla/show_bug.cgi?id=143 $doc->add_term('metadata'); $db->replace_document(-1, $doc); // or 4294967295 = (2^32)-1 $doc=new XapianDocumen...
2008 Aug 19
1
Fwd: Strange error with PHP bindings [some more details]
Finally I noticed something suspect: [2008-08-19 09:11:25] [DEBUG] DAO_Articles::add_xindex() - document added id : 255, title : Gli anelli con sigil... this is a debug line from my application, add_xindex function simply adds the document to xapian database, the error always happens when I try to add an article with id = 255, this can not be a casualty (I also tried to change the order of
2011 Apr 12
1
How to rebuild database from scratch without preventing searches
I have a process which wants to recreate a database nightly (it takes ~10 minutes, and is much faster than trying to figure out what to remove and add from the existing contents). However, opening the database with the flag DB_CREATE_OR_OVERWRITE destroys the existing database and prevents searches from taking place until the rebuild process is finished. We'd like to rebuild the database while still allowing searches to proceed, naturally ... what's the, uh, "recommended" way to do this? Build into a temporary copy an...
2015 Jul 26
1
Get term from document by position
...ude <fstream> class MyText { public: std::string text_str; void set_string(); }; std::string database_dir="db_dir"; std::string query_string="extracellular microbe"; int main(int argc, char **argv) { // indexing Xapian::WritableDatabase db_w(database_dir, Xapian::DB_CREATE_OR_OVERWRITE); MyText text_to_index; text_to_index.set_string(); Xapian::TermGenerator indexer; Xapian::Stem stemmer("english"); indexer.set_stemmer(stemmer); Xapian::Document doc; indexer.set_document(doc); indexer.set_stemming_strategy(Xapian::TermGenerator::STEM_ALL...
2018 Nov 30
1
Xapian Benchmark results
...s = argv[1] + to_string("\\")+to_string(th); char s[30] ; strcpy(s,argv[2]); strcat(s,"/DB"); string idx = to_string(th); strcat(s,idx.c_str()); cout << s << endl; dbs[th] = Xapian::WritableDatabase(s,Xapian::DB_CREATE_OR_OVERWRITE, 512); } Xapian::TermGenerator indexer; Xapian::Stem stemmer("english"); Xapian::Document doc; string line_string; char filename[100]; ifstream infs; char *tok, filepath[1536], content[2048], line[2048]; int i; high_resolution_clock::time_point s...