Tell me more ×  Indexing a Boolean value(true/false) in
lucene(not need to store) I want to get more disk space usage
and higher search performance  doc.add(new Field("boolean","true
",Field.Store.NO,Field.Index.NOT_ANALYZED_NO_NORMS));
doc.add(new Field("boolean","1",Field.Store.NO,Field.Index.NOT_A
NALYZED_NO_NORMS)); doc.add(new NumericField("boolean",Integer.M
AX_VALUE,Field.Store.NO,true).setIntValue(1));  Which should I
choose? Or any other better way?  thanks a lot  share|improve
this question add comment  3 Answers  up vote 6 down vote
accepted  An interesting question!    • I don't think the third
option (NumericField) is a good choice for a boolean field. I
can't think of any use case for this.   • The Lucene search
index (leaving to one side stored data, which you aren't using
anyway) is stored as an inverted index   • Leaving your first
and second options as (theoretically) identical  If I was faced
with this, I think I would choose option one ("true" and "false"
terms), if it influences the final de