QueryParser queryParser = new QueryParser(Version.LUCENE_40, "content", new IKAnalyzer());
Query query = queryParser.parse("VPN");
// 字段值过滤
// Filter f = new FieldValueFilter("content", true);// content中有VPN的过滤掉,不显示
// 前缀过滤
// Filter f = new PrefixFilter(new Term("content", "幸运"));// content中有 '幸运'为前缀过滤掉,不显示
// 数字范围过滤 0,10是范围,后面的两个true的意思是分别是否包含0或10,true:包含 false:包含
Filter f = NumericRangeFilter.newIntRange("content", 0, 10, true, true);
TopDocs top = searcher.search(query, f, 12);