FAQ
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
--
View this message in context: http://www.nabble.com/Conversion-from-Lucene-1.4.3-API-to-2.2.0-API.-tf4958346.html#a14200220
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org

Search Discussions

  • Matthijs Bierman at Dec 7, 2007 at 1:16 pm
    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
  • Ts01 at Dec 7, 2007 at 6:28 pm
    Thanks for your reply. I am aware of the new API, but with the new API that
    you provided we lost the ability to "Store" the field as a string (the
    Value), but "Tokenize" it differently for Indexing, using a Reader.


    Matthijs Bierman wrote:
    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

    --
    View this message in context: http://www.nabble.com/Conversion-from-Lucene-1.4.3-API-to-2.2.0-API.-tf4958346.html#a14217744
    Sent from the Lucene - Java Users mailing list archive at Nabble.com.


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedDec 6, '07 at 8:23p
activeDec 7, '07 at 6:28p
posts3
users2
websitelucene.apache.org

2 users in discussion

Ts01: 2 posts Matthijs Bierman: 1 post

People

Translate

site design / logo © 2022 Grokbase