Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

Lucene 3.6: FieldCache.DEFAULT.getStrings returns array of nulls for some fields

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


lins at softomatix

Jul 24, 2012, 4:10 AM

Post #1 of 2 (165 views)
Permalink
Lucene 3.6: FieldCache.DEFAULT.getStrings returns array of nulls for some fields

Hello Everyone,

I am developing an application with Lucene 3.6 (Java).
I am using a NRTManager to ensure I find the (nearly) newest changes in the index.
I use BooleanQuery containing NumericRangeQuery as BooleanClause(s) (I use 4 of these BooleanClause(s)).
With my custom Sort implementation everything seems to work fine.

Now I want to create a custom collector to control the returned documents. Having read parts
of the book Lucene in action 2010 (page 212) I tried to retrieve the values for the fields
while the method

setNextReader(IndexReader reader, int docBase)

is called in my custom collector and store the arrays to access them in collect (int doc).

The samples in the book show the way to do so (e.g):

String[] urls = FieldCache.DEFAULT.getStrings (reader, "field name");

The problem is that the call returns arrays containing 'null' as values for some fields.
Even if I am quite sure that there are values for the fields.
Other fields are filled as expected.

Am I missing something or has the way to retrieve the values changed between 2.9 and 3.6 and does not work anymore in 3.6?

Thanks,

Oliver


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


lins at softomatix

Jul 24, 2012, 6:10 AM

Post #2 of 2 (167 views)
Permalink
Re: Lucene 3.6: FieldCache.DEFAULT.getStrings returns array of nulls for some fields [In reply to]

Solved.

As written in chapter 5 I have to index the fields if I want to retrieve them
using the field cache.




Am 24.07.2012 13:10, schrieb Oliver:
> Hello Everyone,
>
> I am developing an application with Lucene 3.6 (Java).
> I am using a NRTManager to ensure I find the (nearly) newest changes in the index.
> I use BooleanQuery containing NumericRangeQuery as BooleanClause(s) (I use 4 of these BooleanClause(s)).
> With my custom Sort implementation everything seems to work fine.
>
> Now I want to create a custom collector to control the returned documents. Having read parts
> of the book Lucene in action 2010 (page 212) I tried to retrieve the values for the fields
> while the method
>
> setNextReader(IndexReader reader, int docBase)
>
> is called in my custom collector and store the arrays to access them in collect (int doc).
>
> The samples in the book show the way to do so (e.g):
>
> String[] urls = FieldCache.DEFAULT.getStrings (reader, "field name");
>
> The problem is that the call returns arrays containing 'null' as values for some fields.
> Even if I am quite sure that there are values for the fields.
> Other fields are filled as expected.
>
> Am I missing something or has the way to retrieve the values changed between 2.9 and 3.6 and does not work anymore in 3.6?
>
> Thanks,
>
> Oliver
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.