Displaying 9 results from an estimated 9 matches for "postlist_begin".
2023 Mar 28
1
uncaught C++ exception from Perl Search::Xapian XS?
...S from Debian stable and I'm getting what
> appears to be an unwrapped C++ exception:
>
> terminate called after throwing an instance of 'Xapian::DatabaseModifiedError'
>
> Using `eval' from Perl5 doesn't seem effective in catching it.
>
> I'm using postlist_begin, postlist_end and ++ to iterate a
> PositionIterator, and reading XS/*Iterator.xs, I see the XS
> wrappers are missing:
FWIW, postlist_begin gives you a PostingIterator (positionlist_begin
would give you a PositionIterator).
> try { } catch { handle_exception(); }
>
> in several...
2023 Mar 27
1
uncaught C++ exception from Perl Search::Xapian XS?
I'm using Search::Xapian XS from Debian stable and I'm getting what
appears to be an unwrapped C++ exception:
terminate called after throwing an instance of 'Xapian::DatabaseModifiedError'
Using `eval' from Perl5 doesn't seem effective in catching it.
I'm using postlist_begin, postlist_end and ++ to iterate a
PositionIterator, and reading XS/*Iterator.xs, I see the XS
wrappers are missing:
try { } catch { handle_exception(); }
in several places. Not sure if that's it or if something
else (I know C, but am not remotely fluent in C++).
Thanks
2017 Jun 06
1
Test for the end of PostingIterator in perl?
Hi all. I want to iterate over all the documents in my database.
my $pi = $db->postlist_begin("");
while ("$pi" =~ qr/END/) {
my $oldid = $pi->get_docid;
$pi++;
#...
}
That used to work with Search::Xapian in perl version 1.2, but now with
xapian-bindings-1.4.4 it does not seem to. How are you supposed to tell
when you have reached the end...
2013 Jun 19
2
Compact databases and removing stale records at the same time
I'm trying to compact (or at least merge) multiple databases, while stripping search records which are no longer required.
Backstory:
I've inherited the Cyrus IMAPd xapian-based search code from Greg Banks when he left Opera.
One of the unfinished parts was removing expunged emails from the search database.
We moved from having a single search database to supporting multiple
2013 Jun 19
2
Compact databases and removing stale records at the same time
...;
while (*sources) {
srcdb.add_database(Xapian::Database(*sources++));
}
/* create a destination database */
Xapian::WritableDatabase destdb = Xapian::WritableDatabase(dest, Xapian::DB_CREATE);
/* copy all matching documents to the new DB */
Xapian::PostingIterator it;
for (it = srcdb.postlist_begin(""); it != srcdb.postlist_end(""); it++) {
Xapian::docid did = *it;
Xapian::Document doc = srcdb.get_document(did);
std::string cyrusid = doc.get_value(SLOT_CYRUSID);
if (cb(cyrusid.c_str(), rock)) {
destdb.add_document(doc);
}
}
/* commit all chang...
2010 Jan 16
1
PHP XapianTermIterator/XapianPositionIterator usage
Hello again,
/thanks to Peter for previous response.
I've been digging around trying to find sample usage of
XapianTermIterator/XapianPositionIterator in PHP. The idea is to code up a
test case in PHP to perform snippet extraction (with a possible view to
coding a pecl extension in C). I found a C++ sample, but that wasn't much
help.
I must be dense this morning though, since I
2016 Jan 08
2
Strange index consistency issue
...tshell, some document numbers seem to point to a data blackhole: the
docids are returned when searching for the file/doc unique identifying
term, but then get_document() fails. A later replace_document() succeeds,
but on the next indexing pass, same issue.
// success
docid = db.postlist_begin(uniterm)
// then failure:
xdoc = db.get_document(*docid)
In this situation, Recoll will try to update the doc. replace_document()
then succeeds, and this repeats on the next indexing pass.
This is with Xapian 1.2.16
Here follows a slightly edited version of what the user repo...
2008 Apr 24
3
how to delete all document from the DB (without deleting the DB itself)
Hello,
I'm still testing PHP5 bindings and I could'nt find a way to delete
all documents from a DB without deleting other informations stored in
the DB such as synonyms.
Since the process of adding synonyms is time consuming, I would like
to use the same DB but restart my test without any document in the DB,
is this possibile?
I could'nt find a delete_all or a method like that, nor
2009 Jan 27
1
Segmentation fault in MSetIterator get_weight
Hi,
I'm using xapian with c# and mono and i'm having a segfault in get_weight.
When i print the index variable, the value is clearly too high.
I think something write over it. Do you have any idea on how i could
trace the beginning of the segmentation fault ?
Thanks,
--
Yann