本文整理汇总了Java中org.elasticsearch.search.SearchHit.getType方法的典型用法代码示例。如果您正苦于以下问题:Java SearchHit.getType方法的具体用法?Java SearchHit.getType怎么用?Java SearchHit.getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.search.SearchHit
的用法示例。
在下文中一共展示了SearchHit.getType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createKeyToResultsAndFillOptimizationStructure
import org.elasticsearch.search.SearchHit; //导入方法依赖的package包/类
private void createKeyToResultsAndFillOptimizationStructure(Map<String,Map<String, List<Object>>> optimizationTermsFilterStructure, TableInJoinRequestBuilder firstTableRequest) {
List<SearchHit> firstTableHits = fetchAllHits(firstTableRequest);
int resultIds = 1;
for (SearchHit hit : firstTableHits) {
HashMap<String, List<Map.Entry<Field, Field>>> comparisons = this.hashJoinComparisonStructure.getComparisons();
for (Map.Entry<String, List<Map.Entry<Field, Field>>> comparison : comparisons.entrySet()) {
String comparisonID = comparison.getKey();
List<Map.Entry<Field, Field>> t1ToT2FieldsComparison = comparison.getValue();
String key = getComparisonKey(t1ToT2FieldsComparison, hit, true, optimizationTermsFilterStructure.get(comparisonID));
//int docid , id
InternalSearchHit searchHit = new InternalSearchHit(resultIds, hit.id(), new Text(hit.getType()), hit.getFields());
searchHit.sourceRef(hit.getSourceRef());
onlyReturnedFields(searchHit.sourceAsMap(), firstTableRequest.getReturnedFields(),firstTableRequest.getOriginalSelect().isSelectAll());
resultIds++;
this.hashJoinComparisonStructure.insertIntoComparisonHash(comparisonID, key, searchHit);
}
}
}
示例2: createUnmachedResult
import org.elasticsearch.search.SearchHit; //导入方法依赖的package包/类
protected InternalSearchHit createUnmachedResult( List<Field> secondTableReturnedFields, int docId, String t1Alias, String t2Alias, SearchHit hit) {
String unmatchedId = hit.id() + "|0";
Text unamatchedType = new Text(hit.getType() + "|null");
InternalSearchHit searchHit = new InternalSearchHit(docId, unmatchedId, unamatchedType, hit.getFields());
searchHit.sourceRef(hit.getSourceRef());
searchHit.sourceAsMap().clear();
searchHit.sourceAsMap().putAll(hit.sourceAsMap());
Map<String,Object> emptySecondTableHitSource = createNullsSource(secondTableReturnedFields);
mergeSourceAndAddAliases(emptySecondTableHitSource, searchHit,t1Alias,t2Alias);
return searchHit;
}
示例3: getMergedHit
import org.elasticsearch.search.SearchHit; //导入方法依赖的package包/类
private InternalSearchHit getMergedHit(int currentCombinedResults, String t1Alias, String t2Alias, SearchHit hitFromFirstTable, SearchHit matchedHit) {
onlyReturnedFields(matchedHit.sourceAsMap(), nestedLoopsRequest.getSecondTable().getReturnedFields(),nestedLoopsRequest.getSecondTable().getOriginalSelect().isSelectAll());
InternalSearchHit searchHit = new InternalSearchHit(currentCombinedResults, hitFromFirstTable.id() + "|" + matchedHit.getId(), new Text(hitFromFirstTable.getType() + "|" + matchedHit.getType()), hitFromFirstTable.getFields());
searchHit.sourceRef(hitFromFirstTable.getSourceRef());
searchHit.sourceAsMap().clear();
searchHit.sourceAsMap().putAll(hitFromFirstTable.sourceAsMap());
mergeSourceAndAddAliases(matchedHit.getSource(), searchHit, t1Alias, t2Alias);
return searchHit;
}