作者:mobiledu2502876733 | 来源:互联网 | 2023-09-17 19:55
本文整理了Java中org.apache.solr.client.solrj.response.QueryResponse.getTermsResponse方法的一些代
本文整理了Java中org.apache.solr.client.solrj.response.QueryResponse.getTermsResponse
方法的一些代码示例,展示了QueryResponse.getTermsResponse
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryResponse.getTermsResponse
方法的具体详情如下:
包路径:org.apache.solr.client.solrj.response.QueryResponse
类名称:QueryResponse
方法名:getTermsResponse
QueryResponse.getTermsResponse介绍
暂无
代码示例
代码示例来源:origin: stackoverflow.com
QueryResponse qr = server.query(query);
TermsResponse resp = qr.getTermsResponse();
代码示例来源:origin: spring-projects/spring-data-solr
static Map> convertTermsQueryResponseToTermsMap(@Nullable QueryResponse response) {
if (respOnse== null || response.getTermsResponse() == null || response.getTermsResponse().getTermMap() == null) {
return Collections.emptyMap();
}
TermsResponse termsRespOnse= response.getTermsResponse();
Map> result = new LinkedHashMap<>(termsResponse.getTermMap().size());
for (Map.Entry> entry : termsResponse.getTermMap().entrySet()) {
List terms = new ArrayList<>(entry.getValue().size());
for (Term term : entry.getValue()) {
SimpleTermsFieldEntry termsEntry = new SimpleTermsFieldEntry(term.getTerm(), term.getFrequency());
termsEntry.setField(entry.getKey());
terms.add(termsEntry);
}
result.put(entry.getKey(), terms);
}
return result;
}
代码示例来源:origin: org.pageseeder.flint/pso-flint-solr
public List listTerms(List fields) {
LOGGER.info("List term for fields {}", fields);
List terms = new ArrayList<>();
SolrQuery query = new SolrQuery("*:*");
query.setRequestHandler(this._requestHanlder);
query.setTerms(true);
query.setTermsLimit(this._limit);
for (FlintField field : fields) {
query.addTermsField(field.name());
}
query.setTermsMinCount(1);
query.setTermsSortString("count");
QueryResponse respOnse= this._solr.request(new QueryRequest(query));
if (response != null) {
TermsResponse trespOnse= response.getTermsResponse();
for (FlintField field : fields) {
List ts = tresponse.getTerms(field.name());
if (ts != null) {
for (Term t : ts) {
SolrTerm.Builder builder = new SolrTerm.Builder();
builder.field(field).term(t.getTerm()).frequency(t.getFrequency());
terms.add(builder.build());
}
}
}
}
return terms;
}