lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthijs Bierman <matth...@impressie.nl>
Subject Re: Conversion from Lucene 1.4.3 API to 2.2.0 API.
Date Fri, 07 Dec 2007 13:16:16 GMT
Hi,

I would recommend downloading the 1.9.0 release for porting your code. 
It will show you what's deprecated and the javadoc will show you the 
proper way to do it.
What you would want with your field is:

  /** Constructs a String-valued Field that is tokenized and indexed,
    and is stored in the index, for return with hits. The tokens are
    generated from the reader */
  public static final Field(String name, String value) {
      Field aField = new Field(name, value, Field.Store.NO, Field.Index.TOKENIZED);
      return aField;
  }

If you want to store the field change NO to YES, if you want to store 
the field untokenized change TOKENIZED to UN_TOKENIZED.

Cheers,
Matthijs

ts01 wrote:
> Hi,
>
> With Lucene 1.4.3, we had used this constructor for Field. What is its
> equivalent in Lucene 2.2.0?
>
>   /** Constructs a String-valued Field that is tokenized and indexed,
>     and is stored in the index, for return with hits. The tokens are
>     generated from the reader */
>   public static final Field Text(String name, String value, Reader reader) {
>       Field aField = Text(name, value);
>       aField.readerValue = reader;
>       return aField;
>   }
>
> Thanks
>   


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