IndexSearcher is = new IndexSearcher(indexReader);
QueryParser parser = new QueryParser(searchField, new IKAnalyzer(true));
Query query = parser.parse(searchWords);
TopDocs td = is.search(query, 100000);
ScoreDoc[] sds = td.scoreDocs;
for (ScoreDoc sd : sds) {
Document d = is.doc(sd.doc);
String postId = d.get(LuceneIndex.idFieldName);
MemoInfos memoInfos = new MemoInfos();
String author = d.get(LuceneIndex.memoAuthorFieldName);
int pId = Integer.parseInt(postId);
if (map.containsKey(pId)) {
memoInfos.setWeight(map.get(pId).getWeight() + weight);
map.put(pId, memoInfos);
} else{
memoInfos.setWeight(weight);
map.put(pId, memoInfos);
}
Explanation explanation = is.explain(query, sd.doc);
System.out.println("explanation------" + explanation.toString());
explanation------3.5123634~~~~~~~3.5123634 = (MATCH) product of:
7.024727 = (MATCH) sum of:
7.024727 = (MATCH) weight(memoTitle:python in 51533) [], result of:
7.024727 = score(doc=51533,freq=1.0), product of:
4.7412157 = queryWeight, product of:
4.7412157 = idf(docFreq=1936, maxDocs=81643)
1.0 = queryNorm
1.4816298 = fieldWeight in 51533, product of:
1.0 = tf(freq=1.0), with freq of:
1.0 = termFreq=1.0
4.7412157 = idf(docFreq=1936, maxDocs=81643)
0.3125 = fieldNorm(doc=51533)
0.5 = coord(1/2)
是一个内部超过1k的数组。如何在几个页面中显示它,以便每个页面包含N个div?
答案 0 :(得分:0)
你所谈论的只不过是分页。有许多现成的插件可供使用,或者您可以编写一个。
我希望这会对你有所帮助。