lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: Lucene 4.1 org.apache.lucene.document.Field Deprecation
Date Mon, 18 Mar 2013 16:14:25 GMT
You need to create your own FieldType, e.g.:

  FieldType textWithTermVectors = new FieldType(TextField.TYPE_STORED);
  textWithTermVectors.setStoreTermVectorstrue);
  textWithTermVectors.setStoreTermVectorPositions(true);

Then create new Field("name", "value", textWithTermVectors) and add
that to your document.

Mike McCandless

http://blog.mikemccandless.com


On Mon, Mar 18, 2013 at 12:08 PM, kiwi clive <kiwi_clive@yahoo.com> wrote:
> Hi chaps,
>
> Lucene 4.1.0:
>
> I notice org.apache.lucene.document.Field(String name, String value, Field.Store store,
Field.Index index, Field.TermVector termVector) is marked as deprecated while its suggested
replacements (TextField and StringField) to not seem to have support for Term Vectors.
>
>
> Is there an equivalent of STORED=NO, ANALYZED=YES and TERMVECTORS_WITH_POSITIONS in the
new API?
>
> Apologies if I've missed something, but I don't want to lose this functionality!
>
> Thanks,
> Clive

---------------------------------------------------------------------
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