couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: couchdb-lucene reindexes when restarted
Date Sat, 17 Apr 2010 13:39:22 GMT
This is now fixed on the master branch.

I force a document addition if there wasn't one since the last commit.
You'll see it in doc_count for index functions that don't index


On Fri, Apr 16, 2010 at 12:10 PM, Robert Newson <> wrote:
> Yes, that would be better. 0.4 used to add a dummy document in all
> cases (to track update_seq) so this didn't use to happen. with Lucene
> 2.9/3.0, I'm using commit(userData) instead of a dummy document.
> Unfortunately commit() does nothing if there are no documents added.
> I'll have a fix for this today; I'll just add an empty document if
> there was no other change.
> B.
> On Fri, Apr 16, 2010 at 10:20 AM, Manokaran K <> wrote:
>> On Fri, Apr 16, 2010 at 1:51 PM, Robert Newson <>wrote:
>>> That's more interesting. IIRC, Lucene's commit() method will only
>>> write to disk if there have been document changes. So, if your
>>> function doesn't update anything at all (your function returns null
>>> for all documents, say) then the update_seq won't be updated, and
>>> hence it will start over each time.
>> I think you have got it!
>> I tested the above by creating another doc (after all the others have been
>> generated by the ruby script) that will ensure that at least one _fti index
>> function will return a value. Now, its working as expected - the update_seq
>> got bumped to the latest and survives restarts!!
>> But am curious: would it not be better if lucene bumped up the seq number
>> every time it indexed whether or not the index functions returned a value!
>> thanks a ton for your efforts.
>> regds,
>> mano

View raw message