當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。