lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <bimargul...@gmail.com>
Subject Re: Problem with updating a document or TermQuery with current trunk
Date Tue, 06 Mar 2012 14:23:40 GMT
On Tue, Mar 6, 2012 at 9:20 AM, Robert Muir <rcmuir@gmail.com> wrote:
> I think the issue is that your analyzer is standardanalyzer, yet field
> text value is "value-1"

Robert,

Why is this field analyzed at all? It's built with StringField.TYPE_STORED.

I'll push another copy that shows that it works fine when the doc is
first added, and gets bad after the 'update', when the field acquires
the 'tokenized' boolean mysteriously.

--benson


>
> So standardanalyzer will tokenize this into two terms: "value" and "1"
>
> But later, you proceed to do TermQueries on "value-1". This term won't
> exist... TermQuery etc that take Term don't analyze any text.
>
> Instead usually higher-level things like QueryParsers analyze text into Terms.
>
> On Tue, Mar 6, 2012 at 8:35 AM, Benson Margulies <bimargulies@gmail.com> wrote:
>> I've posted a self-contained test case to github of a mystery.
>>
>> git://github.com/bimargulies/lucene-4-update-case.git
>>
>> The code can be seen at
>> https://github.com/bimargulies/lucene-4-update-case/blob/master/src/test/java/org/apache/lucene/BadFieldTokenizedFlagTest.java.
>>
>> I write a doc to an index, close the index, then reopen and do a
>> delete/add on the doc to add a field. If I iterate the docs in the
>> index, all looks well, but when I try to query for the doc, it isn't
>> found.
>>
>> To be a bit more specific, the doc has a field "field1" which is a
>> StringField.TYPE_STORED, and it is a query on that field which comes
>> up empty.
>>
>> I expect to learn that I've missed something obvious, and I offer
>> thanks and apologies in advance.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>
>
>
> --
> lucidimagination.com
>
> ---------------------------------------------------------------------
> 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