当前位置: 首页>>代码示例>>Java>>正文


Java SearchHit.getType方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:mazhou,项目名称:es-sql,代码行数:23,代码来源:HashJoinElasticExecutor.java

示例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;
}
 
开发者ID:mazhou,项目名称:es-sql,代码行数:16,代码来源:ElasticJoinExecutor.java

示例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;
}
 
开发者ID:mazhou,项目名称:es-sql,代码行数:11,代码来源:NestedLoopsElasticExecutor.java


注:本文中的org.elasticsearch.search.SearchHit.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。