lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Smith <>
Subject RE: Norms and Term Vectors in Lucene 4.0
Date Tue, 30 Oct 2012 17:29:42 GMT
Thanks Simon.  Appears I had it mostly figured out correctly--except for the last question

Thanks for the suggestion on caching the fieldtype.



-----Original Message-----
From: Simon Willnauer [] 
Sent: Tuesday, October 30, 2012 2:10 AM
Subject: Re: Norms and Term Vectors in Lucene 4.0

hey scott,

On Mon, Oct 29, 2012 at 11:56 PM, Scott Smith <> 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);

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!

> Scott

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message