lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <j...@basetechnology.com>
Subject Re: writer.updateDocument() not working (possible bug?)
Date Mon, 19 May 2014 11:30:59 GMT
Out of curiosity, do any of the current crowd of Lucene commiters/users have 
any insight as to how or why that seemingly obvious design requirement was 
ignored or consciously avoided in the original design for Lucene? I've 
always assumed that Lucene (and Solr) were originally designed for a batch 
update model as opposed to a true real-time database (it's a search engine, 
not a database!), but... the original goals and requirements might give us 
some insight.

Thanks.

-- Jack Krupansky

-----Original Message----- 
From: Michael McCandless
Sent: Monday, May 19, 2014 6:10 AM
To: Lucene Users
Subject: Re: writer.updateDocument() not working (possible bug?)

I know, it's a commonly requested feature, but unfortunately it's very
complex to implement.  See e.g. the discussions on
https://issues.apache.org/jira/browse/LUCENE-4258

Mike McCandless

http://blog.mikemccandless.com


On Mon, May 19, 2014 at 5:15 AM, Jamie <jamie@mailarchiva.com> wrote:
> Michael
>
> Thanks for the clarification.
>
> This is a hefty limitation of the Lucene.
>
> One would expect, that you would be able to update a specific field in the
> index without having to reindex the entire document.
>
> Regards
>
> Jamie
>
>
> On 2014/05/16, 11:34 PM, Michael McCandless wrote:
>>
>> You can retrieve the raw content for each field (assuming you stored it).
>>
>> But then you must re-generate a Document from the raw content
>> yourself, as you did originally.
>>
>> Ie you cannot rely on Lucene to remember schema-like things like
>> boost, the FieldType (how the postings were indexed, whether term
>> vectors were indexed, etc.).
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>>
>> On Thu, May 15, 2014 at 12:02 PM, Jamie <jamie@mailarchiva.com> wrote:
>>>
>>> Michael
>>>
>>> How do you update a document that resides in the index without having 
>>> the
>>> original document?
>>>
>>>
>>> Jamie
>>>
>>> On 2014/05/13, 3:30 PM, Michael McCandless wrote:
>>>>
>>>> How did you produce the document that you are sending to
>>>> updateDocument?  Are you loading it from IndexReader.document() or
>>>> IndexSearcher.doc(), changing it, then passing that to
>>>> IW.updateDocument?  If so, that's probably your bug: a loaded document
>>>> is not identical to the original Document you indexed.  In 5.0 we've
>>>> fixed this to be strongly typed ...
>>>>
>>>> Mike McCandless
>>>>
>>>> http://blog.mikemccandless.com
>>>>
>>>>
>>>> On Tue, May 13, 2014 at 9:24 AM, Jamie <jamie@mailarchiva.com> wrote:
>>>>>
>>>>> Greetings
>>>>>
>>>>> I am using Lucene NRT search. After calling 
>>>>> writer.updateDocument(term,
>>>>> doc)
>>>>> and then search(), the document is no longer visible in the search
>>>>> results.
>>>>> The program must be restarted to see it again. In addition, the update
>>>>> is
>>>>> not being applied. The original document (before the update) is 
>>>>> visible
>>>>> in
>>>>> the search results. If updateDocument(term,doc) is called, passing the
>>>>> original doc (without any changes), the doc is still removed from the
>>>>> index
>>>>> (i.e. the change is not the cause). On each search I am calling
>>>>> indexReader
>>>>> = DirectoryReader.open(writer, true); We have tried to call commit()
>>>>> and/or
>>>>> close() immediately after the update, but it makes no difference.
>>>>>
>>>>> This occurs both in Lucene 4.7.2 and 4.8. As far as we know, our code
>>>>> used
>>>>> to work with prior versions of Lucene. Has anyone encountered this?
>>>>>
>>>>> Regards
>>>>>
>>>>> Jamie
>>>>>
>>>>>
>>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message