当我搜索AppEngine Search API时,它只返回20个结果,即使我在索引中有68个项目。参考文档说它最多可以返回10,000个结果。如何返回更多结果?
public Results<ScoredDocument> search(String q) {
log.severe("Searching with query: " + q);
try {
Results<ScoredDocument> results = getIndex().search(q);
log.severe("results.size:"+results.getNumberReturned());
public Index getIndex() {
IndexSpec indexSpec = IndexSpec.newBuilder().setName("OnixIndex").build();
Index index = SearchServiceFactory.getSearchService().getIndex(indexSpec);
return index;
}
E 2013-12-03 17:55:49.858
com.mwv.pic.service.SearchService search: Searching with query:
E 2013-12-03 17:55:51.446
com.mwv.pic.service.SearchService search: results.size:20
应用服务引擎的API-1.0-SDK-1.8.6.jar
答案 0 :(得分:1)
我猜结果中的项目数有一些默认分页。您要查找的数字是getNumberFound()
,其中应包含满足查询的预期结果数。