在老版本里好像只要在new field的时候,加上Field.Index.ANALYZED_NO_NORMS就行了,但是4.6里已经不用这个构造函数了,那么在建textField的索引时,要怎么忽略索引长度对评分的影响
貌似是
private static final FieldType STRING_TPYE_NOT_STORED = new FieldType();
static{
STRING_TPYE_NOT_STORED.setIndexed(true);
[color=red]STRING_TPYE_NOT_STORED.setOmitNorms(false);[/color]
STRING_TPYE_NOT_STORED.setIndexOptions(IndexOptions.DOCS_ONLY);
STRING_TPYE_NOT_STORED.setTokenized(true);
STRING_TPYE_NOT_STORED.setStored(false);
STRING_TPYE_NOT_STORED.freeze();}