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 "Rob Staveley (Tom)" <rs...@seseit.com> on 2006/07/14 15:03:56 UTC

Mixing compressed and uncompressed values

Is this a bad idea?

	String synopsis = /* ....may be any length between 0 and 400
characters */

	// Store, but don't index the synopsis
	// If the synopsis is > 150 characters, we should compress it
	Field field = new Field(
		"synopsis",synopsis
		,synopsis.length() > 150 ? Field.Store.COMPRESS :
Field.Store.YES
		,Field.Index.NO
		);
	field.setOmitNorms(true);
	doc.add(field);

i.e. to compress only long values and wind up with an index with a field
with a mixture of compressed an uncompressed values