Thanks Simon.  Appears I had it mostly figured out correctly--except for the 
last question :-)

Thanks for the suggestion on caching the fieldtype.

Cheers

Scott

-----Original Message-----
From: Simon Willnauer [mailto:simon.willna...@gmail.com] 
Sent: Tuesday, October 30, 2012 2:10 AM
To: java-user@lucene.apache.org
Subject: Re: Norms and Term Vectors in Lucene 4.0

hey scott,

On Mon, Oct 29, 2012 at 11:56 PM, Scott Smith <ssm...@mainstreamdata.com> wrote:
> Converting some code to lucene 4.0, it appears that we can no longer set 
> whether we want to store norms or termvectors using the "sugared" Field 
> classes (e.g., StringField() and TextField).  I gather the defaults are to 
> store norms and to not store termvectors?

the defaults are omitNorms=false & storeTermVectors=false so we don't store TV 
but do store norms by default. In production I usually recommend to use your 
own FieldType and share the instance across fields. In yourcase you can just do 
this:

FieldType t = new FieldType(TextField.TYPE_NOT_STORED);
t.setOmitNorms(true);
t.freeze();

new Field(...,t)

>
> If I don't want norms on a field, then do I need to use the new streamlined 
> Field() and set the appropriate FieldType object parameters?  Is that my only 
> option?
>
> I assume I also have to go through the new Field() if I need to control 
> TermVectors?
>
> Where's LIA3 when you need it :)

yeah man that is a good question!

simon
>
> Scott

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

Reply via email to