lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Storing numeric fields in Apache 6
Date Fri, 29 Apr 2016 08:30:12 GMT
Hi,

- StoredFields don't show up in fields(), because they have nothing to do with the inverted
index: fields() is about the inverted index only and returns references to terms, statistics,...
- PointFields are different than conventional inverted fields, so they also don't show up
in fields(). You cannot get a term dictionary from them.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: j.Pardos [mailto:j.pardos@estructure.es]
> Sent: Friday, April 29, 2016 9:58 AM
> To: java-user@lucene.apache.org
> Subject: Re: Storing numeric fields in Apache 6
> 
> Hello,
> 
> The suggested change worked in part: Luke now shows me the field
> contents, so it's correctly stored, for sure. However, when I ask the
> IndexReader for the field listing (with MultiFields.getFields(IndexReader)
> method) it doesn't return that field. I've noticed in luke that the field is not
> indexed. Is that the reason? How could I fix it?
> 
> Thanks.
> 
> -----Original Message-----
> > From: "Alan Woodward" <alan@flax.co.uk>
> > To: java-user@lucene.apache.org
> > Date: 04/28/16 14:30
> > Subject: Re: Storing numeric fields in Apache 6
> >
> > You should add a StoredField with the same name containing the value:
> >
> > doc.add(new DoublePoint(name, Double.parseDouble(value));
> > doc.add(new StoredField(name, Double.parseDouble(value));
> >
> > Alan Woodward
> > www.flax.co.uk
> >
> >
> > On 28 Apr 2016, at 13:10, j.Pardos wrote:
> >
> > > Hello all,
> > >
> > > I need to index some numeric fields, search with numeric range queries,
> and store the data to retrieve it afterwards.
> > > If I understand correctly, the recommended way to do this in Lucene 6 is
> with the DoublePoint/LongPoint/XxxPoint field types. I have already
> implemented this, extending QueryParser for the numeric range queries, but
> I can't find a way to store the data.
> > >
> > > For example, for double values, I'm doing:
> > > doc.add(new DoublePoint(name, Double.parseDouble(value)));
> > >
> > > DoublePoint doesn't have a "stored" argument in its constructor (as does,
> for example, StringField), or a property to specify it afterwards.
> > >
> > > What's the "right" way to do this?
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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