lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gimantha Bandara <giman...@wso2.com>
Subject Re: Lucene 5.0.0 - StringField and Sorting
Date Mon, 25 Apr 2016 16:04:13 GMT
Yep.. adding a SortedDocValuesField did work for me! thanks..

On Mon, Apr 25, 2016 at 8:39 PM, Michael McCandless <
lucene@mikemccandless.com> wrote:

> The Lucene level javadocs are definitely stale ... I'll fix.
>
> You should separately add a SortedDocValuesField if you also need to sort
> on this field.
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> On Fri, Mar 6, 2015 at 5:04 AM, Torsten Krah <krah.tm@gmail.com> wrote:
>
> > Hi,
> >
> > looking at the JavaDoc of StringField it says:
> >
> > /** A field that is indexed but not tokenized: the entire
> >  *  String value is indexed as a single token.  For example
> >  *  this might be used for a 'country' field or an 'id'
> >  *  field, or any field that you intend to use for sorting
> >  *  or access through the field cache. */
> >
> > So i intend to use some StringFields for sorting.
> > However trying to sort on them fails with:
> >
> > java.lang.IllegalStateException: unexpected docvalues type NONE for
> > field 'NAME_KEYWORD' (expected=SORTED).
> >
> > Was indexed as StringField and Store.YES.
> >
> > So is the JavaDoc wrong here or is it correct and StringField should
> > set:
> >
> > TYPE.setDocValuesType(DocValuesType.SORTED);
> >
> > so it would work?
> >
> > kind regards
> >
> > Torsten
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>



-- 
Gimantha Bandara
Software Engineer
WSO2. Inc : http://wso2.com
Mobile : +94714961919

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message