search for: add_posting

Displaying 18 results from an estimated 18 matches for "add_posting".

2006 Mar 19
4
elemental race conditions question
What''s the standard way to prevent race conditions in controllers? Say user has many posts. Post controller has action add_post that receives user id, post controller find()s the user and while he is creating the post entry an administrator deletes that user in a separate session. We cannot assume the database checks foreign key integrity. How do you get that right? -- fxn
2008 Sep 16
1
Some Questions From the beginner of Xapian
...hen reading the documents, I encountered follow questions. (1) I see the Xapian::Document has a method void add_value (Xapian::valueno valueno, const std::string &value) What's the purpose of this method? Document will related to the terms, but what's the purpose of this? (2) add_posting method will add term to a documents. void add_posting (const std::string &tname, Xapian::termpos tpos, Xapian::termcount wdfinc=1) I noticed that Xapian::TermGenerator has follow method void index_text (const Xapian::Utf8Iterator &itor, Xapian::termcount weight=1, const std::strin...
2008 Aug 16
1
python how do i stem words in python?
hi, i am newbie to xapian and am trying to get started with it in python. there is no stemmer.stem_word method in the latest python library. how do i stem words before doing doc.add_posting? is there any sample hello world code in python that i can use? thanks a lot! >>> stemmer = xapian.Stem('english') >>> stemmer. stemmer.__call__ stemmer.__reduce_ex__ stemmer.__class__ stemmer.__repr__ stemmer.__delattr__ stemm...
2009 Jun 05
2
Blacklist stemming
.... The "natural" way of doing it would be to derive from Stem and override operator ()... but I am using *python-bindings*. Would this be possible? If not I have two other solutions in mind: - add a custom stemmer to Xapian - write custom index & search methods in python using add_posting & hacks to modify the query tree respectively Both solutions are not too appealing. What would be the easiest way to do it? Thanks, Silviu
2006 May 15
1
term / posting question
Hi guys Sorry to take up your time with this, I have just been stuck on a little problem with xapian for a few days here and I can't seem to figure it out for myself. I have created an xapian index (using the php bindings). I have added documents to it, with values, terms and postings. I can successfully search in this index on anything that is in a posting, but if I search on a word that
2006 Jan 22
2
File_column not keeping value during page reloads
I''m trying to use the file_column plug-in to attach a file to a newsletter posting. It works fine if I get the form right the first time, but if I get an error, such as not typing in a required field, and the form re-displays, my file selection box reverts to "no file selected." Here''s my relevant controller code: def new @newsletterpost = Newsletterpost.new
2006 May 31
1
Phrase Query vs AND Query? Why don't these find the same things?
...dd-column-after-hover.gif:(pos=6)))) AND QUERY Xapian::Query((MBOX:12345678-1234-1234-1234-1234567890ab AND LP:backup:(pos=1) AND LP:c::(pos=2) AND LP:program files:(pos=3) AND LP:Mozilla Firefox:(pos=4) AND LP:res:(pos=5) AND LP: table-add-column-after-hover.gif:(pos=6))) given that I have done .add_posting() correctly with the LP: prefixed terms and the second AND Query returns the set of data I expect, why does the first query NOT return ANYTHING? here is what DELVE tells me >delve -r 1 -1 -d -v -k /index/wfs/ Values for record #1: 1:/backup/c:/program files/Mozilla Firefox/res/table- add-colum...
2015 Jan 20
2
Question on "single writer, multiple reader"
On Sun, Jan 18, 2015 at 04:25:29PM +0000, James Aylett wrote: > That?s exactly how it?s supposed to work. ?Eventually? (once the > writer gets sufficiently far ahead of the reader), the reader will get > a DatabaseModifiedError and will have to re-open the database, but > until then it?s up to it when it does so. You may wish to do it every > N requests, or every K seconds, or only
2008 Sep 27
3
Query::MatchAll
Why there still been rank when using Query::MatchAll() ?
2006 Sep 21
6
EOF Error with Unit Tests
I am getting this weird EOFError when running tests using rake When running unit tests one by one (test file by test file), this error does not pop up. Does anyone know what is happening? Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Jan 31
1
retrieving attributes of searchresults
...->{publicationdate}, 'XTYPE' => $data->{articletype}, 'XTID' => $tid, # arrayref 'XTXC' => $txc, # arrayref }); my @words = _get_text($data,$title); for my $i (0 .. $#words) { my $w = $words[$i]; $w =~ s/[\.-]$//g; $doc->add_posting($w,++$i) if $w; } $db->add_document($doc); sub _add_attr { my ($doc,$data) = @_; for my $k (keys %$data) { if (ref $data->{$k}) { # arrayref / multivalue field for my $v (@{$data->{$k}}) { $doc->add_term($k . lc(decode_entities($v))); } } else {...
2006 Dec 16
1
Changing weights per field
I'm not entirely sure if the following is possible with xapian (didn't see much in the way of the documentation that says it is). I have four fields which reference a PK in our DB that I'd like to index (in most weighted to least weighed order): full name, e-mail, title and location. I see I how I can use add_document() to add a concatenated string of the 4 fields, but how would I
2010 Feb 02
1
How to use a custom stemmer from Python bindings?
Hi, I'm using Xapian bindings for Python in my project. How could I use a custom stemmer instead of the included one (Snowball)? The one I'm looking at right now is Hunspell (http://hunspell.sourceforge.net/) which has Python bindings (http://code.google.com/p/pyhunspell/). Thanks in advance, Eugene
2005 Feb 25
2
Bug in TermIterator::skip_to() ?
Hi all, I've been toying with xapian (mostly using the Python bindings) and I think I've hit a bug in the TermIterator::skip_to() method (or maybe in QuartzAllTermsList::skip_to()). I've attached a c++ source file that demonstrates the issue. In short, if you have a WritableDatabase, ask for the all-terms TermIterator with db.allterms_begin(), and then skip_to() a word that is itself
2012 Apr 14
1
[xapian] a bug fixed in brass_database.cc
Hi all, I fixed a bug in brass_database.cc. The bug is: *FIXME: this should be done by checking memory usage, not the number of* *changes. We could also look at the amount of data the inverter object* *currently holds.* I also modified the simpleindex.cc so that it now supports batch files indexing. -- Weixian Zhou Department of Computer Science and Engineering University at Buffalo, SUNY
2011 Apr 21
1
How to Retrieve content of the document?
...->set_data("$File::Find::name")){ warn "can't set_data in doc object for $file: $!\n"; } $line = 1; open(FILE, $file); while (<FILE>){ s/^\W+//; s/\W+$//; @words = split(/\W+/, $_); foreach $tmp (@words){ if ($doc->add_posting($tmp, $line)){ warn "can't add word $tmp $line: $!\n"; } } $line++; } close(FILE); print $doc->values_begin()->get_value(); $db->add_document($doc) or warn "failed to add document: $file\n"; $count++; if ($count%500...
2016 Jul 24
3
Xapian 1.4.0 released
On Fri, Jul 22, 2016 at 07:19:43PM -0700, Kevin Duraj wrote: > I would like to propose to change the following code while indexing a > term that is larger than 245 characters and then crashing and aborting > the entire index, we could rather truncate the term to 245 characters > and continue with indexing. Kevin -- I wonder what others are currently doing when this comes up (or if
2009 Feb 12
1
problem when using xapian's static libs in windows
...Xapian::DB_CREATE_OR_OPEN); // Make the document Xapian::Document newdocument; // Put the data in the document newdocument.set_data(string(argv[2])); // Put the terms into the document for (int i = 3; i < argc; ++i) { newdocument.add_posting(argv[i], i - 2); } // Add the document to the database database.add_document(newdocument); } catch(const Xapian::Error &error) { cout << "Exception: " << error.get_msg() << endl; } return 0; } But when I build it, the...