search for: set_docu

Displaying 17 results from an estimated 17 matches for "set_docu".

Did you mean: set_doc
2010 Oct 24
1
Cannot index with dynamic spelling data (Perl/Search::Xapian)
...an 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: terminate called after throwing an instance of 'Xapian::InvalidOperationError' Aborted It works fine without "$indexer->set_flags(Search::Xapian::FLAG_SPELLING)...
2018 Nov 30
1
Xapian Benchmark results
....getline(line, sizeof(line)); string str(line); if(!str.empty()) { line_string += string(line); } } Xapian::Document doc; doc.set_data(line_string); indexer.set_document(doc); indexer.index_text(line_string); database.add_document(doc); file.close(); } database.commit(); cout <<"count::" <<database.get_doccount() <<endl; } catch (const Xapian::Error &e) { cout << e.get_description() <...
2010 Jun 09
1
TermGenerator incorrectly tokenizes German text which contains special characters
...the MySql database is also in UTF-8 encoding. * #1 $lIndexer = new XapianTermGenerator(); #2 $lStemmer = new XapianStem(XapianHelper::GetStemmer($pLanguage)); // ?german? #3 $lIndexer->set_stemmer($lStemmer); #4 $lDoc = new XapianDocument(); #5 $lDoc->add_term($lObj->Id); #6 $lIndexer->set_document($lDoc); #7 $lIndexer->index_text("Nahrungserg?nzungsmittel Ausrei?er"); #8 $lIndexer->index_text($lSomeStringFromDb);* In the code example just above here the problem only occurs when I try to index text on line #8. The string which get indexed on line #7 is indexed correctly (...
2014 Jan 27
4
Perl Search::Xapian
...1); while (my $csvline = <$fh>) { my $description = $csvline->{DESCRIPTION}; my $title = $csvline->{TITLE}; my $identifier = $csvline->{id_NUMBER}; # We make a doc and tell the term generator to use this. my $doc = Search::Xapian::Document->new(); $tg->set_document($doc); $tg->index_text($title, 1, 'S'); $tg->index_text($description, 1, 'XD'); # index fields without prefixes for general search. $tg->index_text($title); $tg->increase_termpos(); $tg->index_text($description); # Store all the feil...
2007 Dec 17
1
Crashes with spelling enabled and perl.
...t;, Search::Xapian::DB_CREATE_OR_OPEN); if (!defined($db)) { die("Failed to open xapian_database: $!"); } my $indexer = Search::Xapian::TermGenerator->new(); $indexer->set_flags(Search::Xapian::FLAG_SPELLING); my $document = Search::Xapian::Document->new(); $indexer->set_document($document); $indexer->index_text(lc('test'), 1); $db->add_document($document); undef $db; Here's the patch to enable spelling against Search-Xapian-1.0.4.0: http://rusty.devel.infogears.com/xap-perl-spelling.diff Here's the backtrace against 1.0.4: Program received sig...
2007 Dec 29
3
Term-Flags
Hi, Is it necessary to set the down below flag to the TermGenerator, if I want the "Did you mean ..." spelling corrections? Xapian::TermGenerator::flags::FLAG_SPELLING Thank you very much Markus
2012 Jun 04
1
Search not finding queries with stop words.
...my $indexer = Search::Xapian::TermGenerator->new(); my $stemmer = Search::Xapian::Stem->new('english'); $doc->set_data($jsonText); $indexer->set_stemmer($stemmer); $indexer->set_stopper($stopper); $indexer->set_document($doc); $indexer->index_text($docBody); $indexer->increase_termpos(); $indexer->index_text($subject); ... (other index_text and add_value calls) $xdb->add_document($doc); If I look for something like index of elements, I get no re...
2012 Nov 03
1
get the title from the document
...? content = open(filePath).read() ??????? # Prepare document ??????? document = xapian.Document() ??????? document.set_data(content) ??????? # Store fileName ??????? fileName = os.path.basename(filePath) ??????? document.add_value(xapian_file_name, fileName) ??????? # Index document ??????? indexer.set_document(document) ??????? indexer.index_text(content)?????????????????? ??????? ??????? #Store indexed content in database ??????? database.add_document(document) ///////////// code? for searching? ??? query = queryParser.parse_query(queryString)??? ??? enquire.set_query(query) ??? matches = enqu...
2018 Jun 21
0
Welcome to the "Xapian-discuss" mailing list
...play with this is using the NEAR syntax in the query parser. So if you had a plain text document: I am walking, always walking. And index it in a very simple fashion (in python): import xapian db = xapian.WritableDatabase("testdb") doc = xapian.Document() tg = xapian.TermGenerator() tg.set_document(doc) tg.index_text("I am walking, always walking.") db.add_document(doc) Then you can run NEAR queries: import xapian db = xapian.Database("testdb") qp = xapian.QueryParser() qp.set_database(db) def query(query): enq = xapian.Enquire(db) q = qp.parse_query(query)...
2008 Jan 15
7
PHP indexing, what's the PHP method for indexscript
...$doc->add_value(1,date('Ymd',$postrow['postdate'])); $doc->add_value(2,$postrow['author_id']); $doc->add_term("XAUTHORID".$postrow["author_id"]); $doc->add_term("XAUTHORNAME".$postrow["forum_id"]); $indexer->set_document($doc); $indexer->index_text($postrow['post']); //post == sample // Add the document to the database. $database->add_document($doc); ____________________________________________________________________________________ Be a better friend, newshound, and...
2013 Sep 22
2
How to filter search result with query with has white space.
...ian::WritableDatabase db("/Users/ramesh/Desktop/xapian", Xapian::DB_CREATE_OR_OPEN); Xapian::TermGenerator indexer; Xapian::Stem stemmer("english"); indexer.set_stemmer(stemmer); Xapian::Document doc; doc.set_data(d.title); indexer.set_document(doc); indexer.index_text(d.title,1,"title"); indexer.index_text(d.content,1,"content"); indexer.index_text(d.url,1,"url"); doc.add_boolean_term("title"+d.title); db.replace_document(d.url,doc); db.commit();...
2013 Sep 22
2
How to filter search result with query with has white space.
...ian::WritableDatabase db("/Users/ramesh/Desktop/xapian", Xapian::DB_CREATE_OR_OPEN); Xapian::TermGenerator indexer; Xapian::Stem stemmer("english"); indexer.set_stemmer(stemmer); Xapian::Document doc; doc.set_data(d.title); indexer.set_document(doc); indexer.index_text(d.title,1,"title"); indexer.index_text(d.content,1,"content"); indexer.index_text(d.url,1,"url"); doc.add_boolean_term("title"+d.title); db.replace_document(d.url,doc); db.commit();...
2015 Jul 26
1
Get term from document by position
...dexing 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_Z); indexer.index_text(text_to_index.text_str); db_w.add_document(doc); db_w.commit(); db_w.close(); //searching Xapian::Database db(database_dir); Xapian::Enquire enquire(db); Xapian::Qu...
2007 Feb 12
0
[859] trunk/wxruby2/doc/textile/docchildframe.txtl: Added ''methods'' section; removed C++ members
...e_new +* "DocChildFrame#get_document":#DocChildFrame_getdocument +* "DocChildFrame#get_view":#DocChildFrame_getview +* "DocChildFrame#on_activate":#DocChildFrame_onactivate +* "DocChildFrame#on_close_window":#DocChildFrame_onclosewindow +* "DocChildFrame#set_document":#DocChildFrame_setdocument +* "DocChildFrame#set_view":#DocChildFrame_setview </ins><span class="cx"> </span><del>-h3(#DocChildFrame_mchilddocument). DocChildFrame#m__child_document </del><ins>+</div> </ins><span clas...
2007 Feb 12
0
[858] trunk/wxruby2/doc/textile/docmdichildframe.txtl: Added ''methods'' section; removed C++ members
...rame#get_document":#DocMDIChildFrame_getdocument +* "DocMDIChildFrame#get_view":#DocMDIChildFrame_getview +* "DocMDIChildFrame#on_activate":#DocMDIChildFrame_onactivate +* "DocMDIChildFrame#on_close_window":#DocMDIChildFrame_onclosewindow +* "DocMDIChildFrame#set_document":#DocMDIChildFrame_setdocument +* "DocMDIChildFrame#set_view":#DocMDIChildFrame_setview </ins><span class="cx"> </span><del>-Document*m_childDocument </del><ins>+</div> </ins><span class="cx"> </span&g...
2018 Jun 20
2
Welcome to the "Xapian-discuss" mailing list
Hi, I'm new to Xapian and wanted to know if it has a specific feature. I want to be able to check the relation between two terms on a page based on how close they are together on the page. I want to use a combination of n-gram based labeling and the "slop" feature found in Elasticsearch. Does Xapian have this/a similar feature? I haven't been able to find any programs that have
2008 Mar 27
2
Proper noun stemming
Hi All I was wondering if anyone had a solution for the following problem. I user QueryParser to stem my documents before adding them to a database. During the stemming process I would like to find a way of keeping proper nouns that span two or more words together as a phrase. For example "New York" or "Gordon Brown" or "Prime Minister" get spilt up. I see