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 jeffthorne <je...@gmail.com> on 2013/03/22 16:22:37 UTC
Field.Index deprecation ?
I am new to Lucene and going through the Lucene in Action 2nd edition book. I
have a quick question on the best way to add fields to a document now that
Field.Index is deprecated.
Here is what I am doing and what most example online suggest:
doc.add(new Field("id", dbID, Store.YES,
Field.Index.NOT_ANALYZED_NO_NORMS));
What is the new recommended way to set Index properties on Fields with
Field.Index going away? Can't seem to find anything online.
Thanks for the help,
Jeff
--
View this message in context: http://lucene.472066.n3.nabble.com/Field-Index-deprecation-tp4050068.html
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
Re: Field.Index deprecation ?
Posted by Simon Willnauer <si...@gmail.com>.
I think mike is in, ey uwe?
;)
On Sat, Mar 23, 2013 at 5:01 AM, Igal Sapir <ig...@getrailo.org> wrote:
> +1
>
> I own a copy of 2nd Edition and will gladly purchase 3rd Edition when it's
> out.
>
> --
> typos, misspels, and other weird words brought to you courtesy of my mobile
> device and its auto-(in)correct feature.
> On Mar 22, 2013 3:21 PM, "Uwe Schindler" <uw...@thetaphi.de> wrote:
>
>> Come on! :-)
>>
>> -----
>> Uwe Schindler
>> H.-H.-Meier-Allee 63, D-28213 Bremen
>> http://www.thetaphi.de
>> eMail: uwe@thetaphi.de
>>
>> > -----Original Message-----
>> > From: Michael McCandless [mailto:lucene@mikemccandless.com]
>> > Sent: Friday, March 22, 2013 9:41 PM
>> > To: java-user@lucene.apache.org; simon.willnauer@gmail.com
>> > Subject: Re: Field.Index deprecation ?
>> >
>> > On Fri, Mar 22, 2013 at 3:14 PM, Simon Willnauer
>> > <si...@gmail.com> wrote:
>> > > On Fri, Mar 22, 2013 at 5:28 PM, Michael McCandless
>> > > <lu...@mikemccandless.com> wrote:
>> > >> We badly need Lucene in Action 3rd edition!
>> > > go mike go!!!
>> >
>> > Once is enough :)
>> >
>> > Mike McCandless
>> >
>> > http://blog.mikemccandless.com
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> > For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
RE: Field.Index deprecation ?
Posted by Igal Sapir <ig...@getrailo.org>.
+1
I own a copy of 2nd Edition and will gladly purchase 3rd Edition when it's
out.
--
typos, misspels, and other weird words brought to you courtesy of my mobile
device and its auto-(in)correct feature.
On Mar 22, 2013 3:21 PM, "Uwe Schindler" <uw...@thetaphi.de> wrote:
> Come on! :-)
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
> > -----Original Message-----
> > From: Michael McCandless [mailto:lucene@mikemccandless.com]
> > Sent: Friday, March 22, 2013 9:41 PM
> > To: java-user@lucene.apache.org; simon.willnauer@gmail.com
> > Subject: Re: Field.Index deprecation ?
> >
> > On Fri, Mar 22, 2013 at 3:14 PM, Simon Willnauer
> > <si...@gmail.com> wrote:
> > > On Fri, Mar 22, 2013 at 5:28 PM, Michael McCandless
> > > <lu...@mikemccandless.com> wrote:
> > >> We badly need Lucene in Action 3rd edition!
> > > go mike go!!!
> >
> > Once is enough :)
> >
> > Mike McCandless
> >
> > http://blog.mikemccandless.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
RE: Field.Index deprecation ?
Posted by Uwe Schindler <uw...@thetaphi.de>.
Come on! :-)
-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de
> -----Original Message-----
> From: Michael McCandless [mailto:lucene@mikemccandless.com]
> Sent: Friday, March 22, 2013 9:41 PM
> To: java-user@lucene.apache.org; simon.willnauer@gmail.com
> Subject: Re: Field.Index deprecation ?
>
> On Fri, Mar 22, 2013 at 3:14 PM, Simon Willnauer
> <si...@gmail.com> wrote:
> > On Fri, Mar 22, 2013 at 5:28 PM, Michael McCandless
> > <lu...@mikemccandless.com> wrote:
> >> We badly need Lucene in Action 3rd edition!
> > go mike go!!!
>
> Once is enough :)
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Field.Index deprecation ?
Posted by Michael McCandless <lu...@mikemccandless.com>.
On Fri, Mar 22, 2013 at 3:14 PM, Simon Willnauer
<si...@gmail.com> wrote:
> On Fri, Mar 22, 2013 at 5:28 PM, Michael McCandless
> <lu...@mikemccandless.com> wrote:
>> We badly need Lucene in Action 3rd edition!
> go mike go!!!
Once is enough :)
Mike McCandless
http://blog.mikemccandless.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Field.Index deprecation ?
Posted by Simon Willnauer <si...@gmail.com>.
On Fri, Mar 22, 2013 at 5:28 PM, Michael McCandless
<lu...@mikemccandless.com> wrote:
> We badly need Lucene in Action 3rd edition!
go mike go!!!
;)
>
> The easiest approach is to use one of the new XXXField classes under
> oal.document, eg StringField for your example.
>
> If none of the existing XXXFields "fit", you can make a custom
> FieldType, tweak all of its settings, and then create a Field from
> that.
>
> Mike McCandless
>
> http://blog.mikemccandless.com
>
> On Fri, Mar 22, 2013 at 11:22 AM, jeffthorne <je...@gmail.com> wrote:
>> I am new to Lucene and going through the Lucene in Action 2nd edition book. I
>> have a quick question on the best way to add fields to a document now that
>> Field.Index is deprecated.
>>
>> Here is what I am doing and what most example online suggest:
>>
>> doc.add(new Field("id", dbID, Store.YES,
>> Field.Index.NOT_ANALYZED_NO_NORMS));
>>
>> What is the new recommended way to set Index properties on Fields with
>> Field.Index going away? Can't seem to find anything online.
>>
>> Thanks for the help,
>> Jeff
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://lucene.472066.n3.nabble.com/Field-Index-deprecation-tp4050068.html
>> 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
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Field.Index deprecation ?
Posted by jeffthorne <je...@gmail.com>.
Thanks again for the help Mike. Much appreciated.
Have a good one,
Jeff
--
View this message in context: http://lucene.472066.n3.nabble.com/Field-Index-deprecation-tp4050068p4050766.html
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
Re: Field.Index deprecation ?
Posted by Michael McCandless <lu...@mikemccandless.com>.
On Sat, Mar 23, 2013 at 9:12 AM, jeffthorne <je...@gmail.com> wrote:
> Thanks for the response Mike and pointing me in the right direction.
>
> I see that
>
> TextField is indexed, tokenized, without term vectors
> StringField is indexed, but not tokenized
>
>
> If I wanted a stored field that is tokenized with stored term vectors would
> this be the recommended approach?
>
> FieldType customFieldType = new FieldType();
> customFieldType.setStored(true);
> customFieldType.setIndexed(true);
> customFieldType.setTokenized(true);
> customFieldType.setStoreTermVectors(true);
Yes, and maybe also .setStoreTermVectorOffsets/Positions(true).
You can also start from an existing type, eg:
FieldType ft = new FieldType(TextField.TYPE_STORED);
ft.setStoreTermVectors(true);
Mike McCandless
http://blog.mikemccandless.com
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Field.Index deprecation ?
Posted by jeffthorne <je...@gmail.com>.
Thanks for the response Mike and pointing me in the right direction.
I see that
TextField is indexed, tokenized, without term vectors
StringField is indexed, but not tokenized
If I wanted a stored field that is tokenized with stored term vectors would
this be the recommended approach?
FieldType customFieldType = new FieldType();
customFieldType.setStored(true);
customFieldType.setIndexed(true);
customFieldType.setTokenized(true);
customFieldType.setStoreTermVectors(true);
doc.add("contents", customFieldType);
Cheers,
Jeff
--
View this message in context: http://lucene.472066.n3.nabble.com/Field-Index-deprecation-tp4050068p4050738.html
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
Re: Field.Index deprecation ?
Posted by Michael McCandless <lu...@mikemccandless.com>.
We badly need Lucene in Action 3rd edition!
The easiest approach is to use one of the new XXXField classes under
oal.document, eg StringField for your example.
If none of the existing XXXFields "fit", you can make a custom
FieldType, tweak all of its settings, and then create a Field from
that.
Mike McCandless
http://blog.mikemccandless.com
On Fri, Mar 22, 2013 at 11:22 AM, jeffthorne <je...@gmail.com> wrote:
> I am new to Lucene and going through the Lucene in Action 2nd edition book. I
> have a quick question on the best way to add fields to a document now that
> Field.Index is deprecated.
>
> Here is what I am doing and what most example online suggest:
>
> doc.add(new Field("id", dbID, Store.YES,
> Field.Index.NOT_ANALYZED_NO_NORMS));
>
> What is the new recommended way to set Index properties on Fields with
> Field.Index going away? Can't seem to find anything online.
>
> Thanks for the help,
> Jeff
>
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Field-Index-deprecation-tp4050068.html
> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org