public static CandidateResult parseIndexDocId( final SearchHit hit, boolean hasGeoSortPredicates ) { final String documentId = hit.getId(); // geosort predicates always added as the first sort in the ES filter, and the distance is represented as the // corresponding sortValue in the searchHit. // see org.apache.usergrid.persistence.index.impl.SearchRequestBuilderStrategy.applySortPredicates() final double distance = hasGeoSortPredicates ? (double) hit.sortValues()[0] : -1; return parseIndexDocId(documentId,distance); }
public void sortValues(Object[] sortValues, DocValueFormat[] sortValueFormats) { sortValues(new SearchSortValues(sortValues, sortValueFormats)); }
if (sortedTopDocs.isSortedByField) { FieldDoc fieldDoc = (FieldDoc) shardDoc; searchHit.sortValues(fieldDoc.fields, reducedQueryPhase.sortValueFormats); if (sortScoreIndex != -1) { searchHit.score(((Number) fieldDoc.fields[sortScoreIndex]).floatValue());
/** * An array of the sort values used. */ public Object[] getSortValues() { return sortValues(); }
@Override public Object[] sortValues() { return this.searchHit.sortValues(); }
if (scoreDoc instanceof FieldDoc) { FieldDoc fieldDoc = (FieldDoc) scoreDoc; searchHitFields.sortValues(fieldDoc.fields, innerHits.sort().formats);
searchHit.sortValues(get(Fields.SORT, values, SearchSortValues.EMPTY)); searchHit.highlightFields(get(Fields.HIGHLIGHT, values, null)); searchHit.sourceRef(get(SourceFieldMapper.NAME, values, null));
public void sortValues(Object[] sortValues, DocValueFormat[] sortValueFormats) { sortValues(new SearchSortValues(sortValues, sortValueFormats)); }
public void sortValues(Object[] sortValues, DocValueFormat[] sortValueFormats) { sortValues(new SearchSortValues(sortValues, sortValueFormats)); }
public void sortValues(Object[] sortValues, DocValueFormat[] sortValueFormats) { sortValues(new SearchSortValues(sortValues, sortValueFormats)); }
if (scoreDoc instanceof FieldDoc) { FieldDoc fieldDoc = (FieldDoc) scoreDoc; searchHitFields.sortValues(fieldDoc.fields, subSearchContext.sort().formats);
if (sorted) { FieldDoc fieldDoc = (FieldDoc) shardDoc; searchHit.sortValues(fieldDoc.fields, reducedQueryPhase.sortValueFormats); if (sortScoreIndex != -1) { searchHit.score(((Number) fieldDoc.fields[sortScoreIndex]).floatValue());
if (scoreDoc instanceof FieldDoc) { FieldDoc fieldDoc = (FieldDoc) scoreDoc; searchHitFields.sortValues(fieldDoc.fields, innerHits.sort().formats);
searchHit.sortValues(get(Fields.SORT, values, SearchSortValues.EMPTY)); searchHit.highlightFields(get(Fields.HIGHLIGHT, values, null)); searchHit.sourceRef(get(SourceFieldMapper.NAME, values, null));
if (scoreDoc instanceof FieldDoc) { FieldDoc fieldDoc = (FieldDoc) scoreDoc; searchHitFields.sortValues(fieldDoc.fields, innerHits.sort().formats);
if (scoreDoc instanceof FieldDoc) { FieldDoc fieldDoc = (FieldDoc) scoreDoc; searchHitFields.sortValues(fieldDoc.fields, innerHits.sort().formats);
searchHit.sortValues(get(Fields.SORT, values, SearchSortValues.EMPTY)); searchHit.highlightFields(get(Fields.HIGHLIGHT, values, null)); searchHit.sourceRef(get(SourceFieldMapper.NAME, values, null));
public static SearchHit createFromMap(Map<String, Object> values) { String id = get(Fields._ID, values, null); Text type = get(Fields._TYPE, values, null); NestedIdentity nestedIdentity = get(NestedIdentity._NESTED, values, null); Map<String, SearchHitField> fields = get(Fields.FIELDS, values, null); SearchHit searchHit = new SearchHit(-1, id, type, nestedIdentity, fields); searchHit.index = get(Fields._INDEX, values, null); searchHit.score(get(Fields._SCORE, values, DEFAULT_SCORE)); searchHit.version(get(Fields._VERSION, values, -1L)); searchHit.sortValues(get(Fields.SORT, values, SearchSortValues.EMPTY)); searchHit.highlightFields(get(Fields.HIGHLIGHT, values, null)); searchHit.sourceRef(get(SourceFieldMapper.NAME, values, null)); searchHit.explanation(get(Fields._EXPLANATION, values, null)); searchHit.setInnerHits(get(Fields.INNER_HITS, values, null)); List<String> matchedQueries = get(Fields.MATCHED_QUERIES, values, null); if (matchedQueries != null) { searchHit.matchedQueries(matchedQueries.toArray(new String[matchedQueries.size()])); } ShardId shardId = get(Fields._SHARD, values, null); String nodeId = get(Fields._NODE, values, null); if (shardId != null && nodeId != null) { searchHit.shard(new SearchShardTarget(nodeId, shardId, null, OriginalIndices.NONE)); } searchHit.fields(fields); return searchHit; }
if (scoreDoc instanceof FieldDoc) { FieldDoc fieldDoc = (FieldDoc) scoreDoc; searchHitFields.sortValues(fieldDoc.fields, subSearchContext.sort().formats);
if (scoreDoc instanceof FieldDoc) { FieldDoc fieldDoc = (FieldDoc) scoreDoc; searchHitFields.sortValues(fieldDoc.fields, subSearchContext.sort().formats);