You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by kiwi clive <ki...@yahoo.com> on 2013/03/18 17:08:00 UTC

Lucene 4.1 org.apache.lucene.document.Field Deprecation

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

Re: Lucene 4.1 org.apache.lucene.document.Field Deprecation

Posted by kiwi clive <ki...@yahoo.com>.
Thank you Mike,

Much appreciated :-)




________________________________
 From: Michael McCandless <lu...@mikemccandless.com>
To: java-user@lucene.apache.org; kiwi clive <ki...@yahoo.com> 
Sent: Monday, March 18, 2013 4:14 PM
Subject: Re: Lucene 4.1 org.apache.lucene.document.Field Deprecation
 
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 <ki...@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

Re: Lucene 4.1 org.apache.lucene.document.Field Deprecation

Posted by Michael McCandless <lu...@mikemccandless.com>.
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 <ki...@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