code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Override
public IndexCoordinates getIndexCoordinates() {
return reactiveIndexOperations.getIndexCoordinates();
} | Adapter for creating synchronous calls for a reactive {@link ReactiveIndexOperations}.
@author Peter-Josef Meisch
@since 5.2 | getIndexCoordinates | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/IndexOperationsAdapter.java | Apache-2.0 |
public static <T> MultiGetItem<T> of(@Nullable T item, @Nullable Failure failure) {
return new MultiGetItem<>(item, failure);
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | of | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
public boolean hasItem() {
return item != null;
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | hasItem | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
@Nullable
public T getItem() {
return item;
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | getItem | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
public boolean isFailed() {
return failure != null;
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | isFailed | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
@Nullable
public Failure getFailure() {
return failure;
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | getFailure | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
public static Failure of(String index, @Nullable String type, String id, @Nullable Exception exception,
@Nullable ElasticsearchErrorCause elasticsearchErrorCause) {
return new Failure(index, type, id, exception, elasticsearchErrorCause);
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | of | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
@Nullable
public String getIndex() {
return index;
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | getIndex | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
@Nullable
public String getType() {
return type;
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | getType | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
@Nullable
public String getId() {
return id;
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | getId | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
@Nullable
public Exception getException() {
return exception;
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | getException | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
@Nullable
public ElasticsearchErrorCause getElasticsearchErrorCause() {
return elasticsearchErrorCause;
} | Response object for items returned from multiget requests, encapsulating the returned data and potential error
information.
@param <T> the entity type
@author Peter-Josef Meisch
@since 4.2 | getElasticsearchErrorCause | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/MultiGetItem.java | Apache-2.0 |
default Mono<Void> bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index) {
return bulkUpdate(queries, BulkOptions.defaultOptions(), index);
} | Bulk update all objects. Will do update. On errors returns with
{@link org.springframework.data.elasticsearch.BulkFailureException} with information about the failed operation
@param queries the queries to execute in bulk
@since 4.0 | bulkUpdate | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveDocumentOperations.java | Apache-2.0 |
default Mono<Boolean> putMapping() {
return putMapping(createMapping());
} | Writes the mapping to the index for the class this IndexOperations is bound to.
@return {@literal true} if the mapping could be stored | putMapping | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
default Mono<Boolean> putMapping(Class<?> clazz) {
return putMapping(createMapping(clazz));
} | Creates the index mapping for the given class and writes it to the index.
@param clazz the clazz to create a mapping for
@return {@literal true} if the mapping could be stored | putMapping | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
default Mono<Settings> getSettings() {
return getSettings(false);
} | get the settings for the index
@return a {@link Mono} with a {@link Document} containing the index settings | getSettings | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
default Mono<Boolean> existsIndexTemplate(String indexTemplateName) {
return existsIndexTemplate(new ExistsIndexTemplateRequest(indexTemplateName));
} | Checks if an index template exists.
@param indexTemplateName the name of the index template
@return Mono with the value if the index template exists.
@since 5.1 | existsIndexTemplate | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
default Flux<TemplateResponse> getIndexTemplate(String indexTemplateName) {
return getIndexTemplate(new GetIndexTemplateRequest(indexTemplateName));
} | Get index template(s).
@param indexTemplateName the name of the index template
@return a {@link Flux} of {@link TemplateResponse}
@since 5.1 | getIndexTemplate | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
default Mono<Boolean> deleteIndexTemplate(String indexTemplateName) {
return deleteIndexTemplate(new DeleteIndexTemplateRequest(indexTemplateName));
} | Deletes an index template.
@param indexTemplateName the name of the index template
@return Mono with the value if the request was acknowledged.
@since 5.1 | deleteIndexTemplate | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
@Deprecated
default Mono<TemplateData> getTemplate(String templateName) {
return getTemplate(new GetTemplateRequest(templateName));
} | gets an index template using the legacy Elasticsearch interface.
@param templateName the template name
@return Mono of TemplateData, {@literal Mono.empty()} if no template with the given name exists.
@since 4.1
@deprecated since 5.1, as the underlying Elasticsearch API is deprecated. | getTemplate | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
@Deprecated
default Mono<Boolean> existsTemplate(String templateName) {
return existsTemplate(new ExistsTemplateRequest(templateName));
} | Checks if an index template exists using the legacy Elasticsearch interface (@see
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)
@param templateName the template name
@return Mono of {@literal true} if the template exists
@since 4.1
@deprecated since 5.1, as the underlying E... | existsTemplate | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
@Deprecated
default Mono<Boolean> deleteTemplate(String templateName) {
return deleteTemplate(new DeleteTemplateRequest(templateName));
} | Deletes an index template using the legacy Elasticsearch interface (@see
https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html)
@param templateName the template name
@return Mono of {@literal true} if the template could be deleted
@since 4.1
@deprecated since 5.1, as the underlying ... | deleteTemplate | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
default Flux<IndexInformation> getInformation() {
return getInformation(getIndexCoordinates());
} | Gets the {@link IndexInformation} for the indices defined by {@link #getIndexCoordinates()}.
@return a flux of {@link IndexInformation}
@since 4.2 | getInformation | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveIndexOperations.java | Apache-2.0 |
public static Mono<Document> loadDocument(String path, String annotation) {
if (hasText(path)) {
return readFileFromClasspath(path).flatMap(s -> {
if (hasText(s)) {
return Mono.just(Document.parse(s));
} else {
return Mono.just(Document.create());
}
});
} else {
if (LOGGER.isInfoEnab... | loads a Document initialized with data from a given resource path.
@param path the path to load data from
@param annotation the annotation that had the resource path defined
@return the parsed document
@since 4.4 | loadDocument | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveResourceUtil.java | Apache-2.0 |
@Override
public long getTotalHits() {
return delegate.getTotalHits();
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | getTotalHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
@Override
public TotalHitsRelation getTotalHitsRelation() {
return delegate.getTotalHitsRelation();
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | getTotalHitsRelation | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
@Override
public boolean hasAggregations() {
return delegate.hasAggregations();
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | hasAggregations | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
@Override
@Nullable
public AggregationsContainer<?> getAggregations() {
return delegate.getAggregations();
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | getAggregations | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
@Override
public float getMaxScore() {
return delegate.getMaxScore();
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | getMaxScore | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
@Override
public Duration getExecutionDuration() {
return delegate.getExecutionDuration();
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | getExecutionDuration | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
@Override
public boolean hasSearchHits() {
return delegate.hasSearchHits();
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | hasSearchHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
@Override
public Flux<SearchHit<T>> getSearchHits() {
return Flux.defer(() -> Flux.fromIterable(delegate.getSearchHits()));
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | getSearchHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
@Override
@Nullable
public Suggest getSuggest() {
return delegate.getSuggest();
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | getSuggest | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
@Override
public boolean hasSuggest() {
return delegate.hasSuggest();
} | @author Peter-Josef Meisch
@author Mohamed El Harrougui
@since 4.4 | hasSuggest | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchHitsImpl.java | Apache-2.0 |
default Mono<String> openPointInTime(IndexCoordinates index, Duration keepAlive) {
return openPointInTime(index, keepAlive, false);
} | Opens a point in time (pit) in Elasticsearch.
@param index the index name(s) to use
@param keepAlive the duration the pit shoult be kept alive
@return the pit identifier
@since 5.0 | openPointInTime | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ReactiveSearchOperations.java | Apache-2.0 |
public static String readFileFromClasspath(String url) {
Assert.notNull(url, "url must not be null");
try (InputStream is = new ClassPathResource(url).getInputStream()) {
return StreamUtils.copyToString(is, Charset.defaultCharset());
} catch (Exception e) {
throw new ResourceFailureException("Could not lo... | Read a {@link ClassPathResource} into a {@link String}.
@param url url the resource
@return the contents of the resource | readFileFromClasspath | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/ResourceUtil.java | Apache-2.0 |
@Nullable
public String getIndex() {
return index;
} | @return the index name where the hit's document was found
@since 4.1 | getIndex | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
@Nullable
public String getId() {
return id;
} | @return the index name where the hit's document was found
@since 4.1 | getId | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
public float getScore() {
return score;
} | @return the score for the hit. | getScore | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
public T getContent() {
return content;
} | @return the object data from the search. | getContent | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
public List<Object> getSortValues() {
return Collections.unmodifiableList(sortValues);
} | @return the sort values if the query had a sort criterion. | getSortValues | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
public Map<String, List<String>> getHighlightFields() {
return Collections.unmodifiableMap(highlightFields.entrySet().stream()
.collect(Collectors.toMap(Map.Entry::getKey, entry -> Collections.unmodifiableList(entry.getValue()))));
} | @return the map from field names to highlight values, never {@literal null} | getHighlightFields | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
public List<String> getHighlightField(String field) {
Assert.notNull(field, "field must not be null");
return Collections.unmodifiableList(highlightFields.getOrDefault(field, Collections.emptyList()));
} | gets the highlight values for a field.
@param field must not be {@literal null}
@return possibly empty List, never null | getHighlightField | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
@Nullable
public SearchHits<?> getInnerHits(String name) {
return innerHits.get(name);
} | returns the {@link SearchHits} for the inner hits with the given name. If the inner hits could be mapped to a
nested entity class, the returned data will be of this type, otherwise
{{@link org.springframework.data.elasticsearch.core.document.SearchDocument}} instances are returned in this
{@link SearchHits} object.
@p... | getInnerHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
public Map<String, SearchHits<?>> getInnerHits() {
return innerHits;
} | @return the map from inner_hits names to inner hits, in a {@link SearchHits} object, never {@literal null}
@since 4.1 | getInnerHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
@Nullable
public NestedMetaData getNestedMetaData() {
return nestedMetaData;
} | If this is a nested inner hit, return the nested metadata information
@return {{@link NestedMetaData}
@since 4.1 | getNestedMetaData | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
@Override
public String toString() {
return "SearchHit{" + "id='" + id + '\'' + ", score=" + score + ", sortValues=" + sortValues + ", content="
+ content + ", highlightFields=" + highlightFields + '}';
} | If this is a nested inner hit, return the nested metadata information
@return {{@link NestedMetaData}
@since 4.1 | toString | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
@Nullable
public String getRouting() {
return routing;
} | @return the routing for this SearchHit, may be {@literal null}.
@since 4.2 | getRouting | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
@Nullable
public Explanation getExplanation() {
return explanation;
} | @return the explanation for this SearchHit.
@since 4.2 | getExplanation | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
@Nullable
public Map<String, Double> getMatchedQueries() {
return matchedQueries;
} | @return the matched queries for this SearchHit. | getMatchedQueries | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHit.java | Apache-2.0 |
public static <T> SearchHitMapping<T> mappingFor(Class<T> entityClass, ElasticsearchConverter converter) {
return new SearchHitMapping<>(entityClass, converter);
} | @author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Matt Gilene
@author Sascha Woo
@author Jakob Hoeper
@author Haibo Liu
@author Mohamed El Harrougui
@since 4.0 | mappingFor | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
public SearchHits<T> mapHits(SearchDocumentResponse searchDocumentResponse, List<T> contents) {
return mapHitsFromResponse(searchDocumentResponse, contents);
} | @author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Matt Gilene
@author Sascha Woo
@author Jakob Hoeper
@author Haibo Liu
@author Mohamed El Harrougui
@since 4.0 | mapHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
SearchScrollHits<T> mapScrollHits(SearchDocumentResponse searchDocumentResponse, List<T> contents) {
return mapHitsFromResponse(searchDocumentResponse, contents);
} | @author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Matt Gilene
@author Sascha Woo
@author Jakob Hoeper
@author Haibo Liu
@author Mohamed El Harrougui
@since 4.0 | mapScrollHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
private SearchHitsImpl<T> mapHitsFromResponse(SearchDocumentResponse searchDocumentResponse, List<T> contents) {
Assert.notNull(searchDocumentResponse, "searchDocumentResponse is null");
Assert.notNull(contents, "contents is null");
Assert.isTrue(searchDocumentResponse.getSearchDocuments().size() == contents.si... | @author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Matt Gilene
@author Sascha Woo
@author Jakob Hoeper
@author Haibo Liu
@author Mohamed El Harrougui
@since 4.0 | mapHitsFromResponse | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
@SuppressWarnings("unchecked")
public void mapHitsInCompletionSuggestion(@Nullable Suggest suggest) {
if (suggest != null) {
for (Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>> suggestion : suggest
.getSuggestions()) {
if (suggestion instanceof Completio... | @author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Matt Gilene
@author Sascha Woo
@author Jakob Hoeper
@author Haibo Liu
@author Mohamed El Harrougui
@since 4.0 | mapHitsInCompletionSuggestion | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
public SearchHit<T> mapHit(SearchDocument searchDocument, T content) {
Assert.notNull(searchDocument, "searchDocument is null");
Assert.notNull(content, "content is null");
return new SearchHit<>(searchDocument.getIndex(), //
searchDocument.hasId() ? searchDocument.getId() : null, //
searchDocument.getR... | @author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Matt Gilene
@author Sascha Woo
@author Jakob Hoeper
@author Haibo Liu
@author Mohamed El Harrougui
@since 4.0 | mapHit | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
@Nullable
private Map<String, List<String>> getHighlightsAndRemapFieldNames(SearchDocument searchDocument) {
Map<String, List<String>> highlightFields = searchDocument.getHighlightFields();
if (highlightFields == null) {
return null;
}
ElasticsearchPersistentEntity<?> persistentEntity = mappingContext.get... | @author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Matt Gilene
@author Sascha Woo
@author Jakob Hoeper
@author Haibo Liu
@author Mohamed El Harrougui
@since 4.0 | getHighlightsAndRemapFieldNames | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
private Map<String, SearchHits<?>> mapInnerHits(SearchDocument searchDocument) {
Map<String, SearchHits<?>> innerHits = new LinkedHashMap<>();
Map<String, SearchDocumentResponse> documentInnerHits = searchDocument.getInnerHits();
if (documentInnerHits != null && !documentInnerHits.isEmpty()) {
SearchHitMapp... | @author Rizwan Idrees
@author Mohsin Husen
@author Christoph Strobl
@author Peter-Josef Meisch
@author Mark Paluch
@author Roman Puchkovskiy
@author Matt Gilene
@author Sascha Woo
@author Jakob Hoeper
@author Haibo Liu
@author Mohamed El Harrougui
@since 4.0 | mapInnerHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
private SearchHits<?> mapInnerDocuments(SearchHits<SearchDocument> searchHits, Class<T> type) {
if (searchHits.isEmpty()) {
return searchHits;
}
try {
ElasticsearchPersistentEntity<?> persistentEntityForType = mappingContext.getPersistentEntity(type);
NestedMetaData nestedMetaData = searchHits.getSearc... | try to convert the SearchDocument instances to instances of the inner property class.
@param searchHits {@link SearchHits} containing {@link Document} instances
@param type the class of the containing class
@return a new {@link SearchHits} instance containing the mapped objects or the original inout if any error occur... | mapInnerDocuments | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
private ElasticsearchPersistentEntityWithNestedMetaData getPersistentEntity(
@Nullable ElasticsearchPersistentEntity<?> persistentEntity, @Nullable NestedMetaData nestedMetaData) {
NestedMetaData currentMetaData = nestedMetaData;
List<NestedMetaData> mappedNestedMetaDatas = new LinkedList<>();
while (persist... | find a {@link ElasticsearchPersistentEntity} following the property chain defined by the nested metadata
@param persistentEntity base entity
@param nestedMetaData nested metadata
@return A {@link ElasticsearchPersistentEntityWithNestedMetaData} containing the found entity or null together with
the {@link Neste... | getPersistentEntity | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitMapping.java | Apache-2.0 |
default boolean hasAggregations() {
return getAggregations() != null;
} | @return true if aggregations are available | hasAggregations | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java | Apache-2.0 |
default boolean hasSearchHits() {
return !getSearchHits().isEmpty();
} | @return whether the {@link SearchHits} has search hits. | hasSearchHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java | Apache-2.0 |
default boolean hasSuggest() {
return getSuggest() != null;
} | @return wether the {@link SearchHits} has a suggest response.
@since 4.3 | hasSuggest | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java | Apache-2.0 |
default Iterator<SearchHit<T>> iterator() {
return getSearchHits().iterator();
} | @return an iterator for {@link SearchHit} | iterator | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHits.java | Apache-2.0 |
@Override
public long getTotalHits() {
return totalHits;
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getTotalHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
public TotalHitsRelation getTotalHitsRelation() {
return totalHitsRelation;
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getTotalHitsRelation | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
public float getMaxScore() {
return maxScore;
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getMaxScore | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
public Duration getExecutionDuration() {
return executionDuration;
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getExecutionDuration | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
@Nullable
public String getScrollId() {
return scrollId;
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getScrollId | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
public List<SearchHit<T>> getSearchHits() {
return unmodifiableSearchHits.get();
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getSearchHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
public SearchHit<T> getSearchHit(int index) {
return searchHits.get(index);
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getSearchHit | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
@Nullable
public AggregationsContainer<?> getAggregations() {
return aggregations;
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getAggregations | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
@Nullable
public Suggest getSuggest() {
return suggest;
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getSuggest | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Nullable
@Override
public String getPointInTimeId() {
return pointInTimeId;
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getPointInTimeId | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
public SearchShardStatistics getSearchShardStatistics() {
return searchShardStatistics;
} | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | getSearchShardStatistics | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
@Override
public String toString() {
return "SearchHits{" + //
"totalHits=" + totalHits + //
", totalHitsRelation=" + totalHitsRelation + //
", maxScore=" + maxScore + //
", executionDuration=" + executionDuration + //
", scrollId='" + scrollId + '\'' + //
", pointInTimeId='" + pointInTimeId ... | @param totalHits the number of total hits for the search
@param totalHitsRelation the relation {@see TotalHitsRelation}, must not be {@literal null}
@param maxScore the maximum score
@param executionDuration the execution duration it took to complete the request
@param scrollId the scroll id if available
@param searchH... | toString | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsImpl.java | Apache-2.0 |
default boolean hasAggregations() {
return getAggregations() != null;
} | @return true if aggregations are available | hasAggregations | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitsIterator.java | Apache-2.0 |
@Nullable
public static Object unwrapSearchHits(@Nullable Object result) {
if (result == null) {
return result;
}
if (result instanceof SearchHit<?>) {
return ((SearchHit<?>) result).getContent();
}
if (result instanceof List<?>) {
return ((List<?>) result).stream() //
.map(SearchHitSupport:... | unwraps the data contained in a SearchHit for different types containing SearchHits if possible
@param result the object, list, page or whatever containing SearchHit objects
@return a corresponding object where the SearchHits are replaced by their content if possible, otherwise the
original object | unwrapSearchHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | Apache-2.0 |
private static CloseableIterator<?> unwrapSearchHitsIterator(SearchHitsIterator<?> iterator) {
return new CloseableIterator<>() {
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public Object next() {
return unwrapSearchHits(iterator.next());
}
@Override
... | unwraps the data contained in a SearchHit for different types containing SearchHits if possible
@param result the object, list, page or whatever containing SearchHit objects
@return a corresponding object where the SearchHits are replaced by their content if possible, otherwise the
original object | unwrapSearchHitsIterator | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | Apache-2.0 |
@Override
public boolean hasNext() {
return iterator.hasNext();
} | unwraps the data contained in a SearchHit for different types containing SearchHits if possible
@param result the object, list, page or whatever containing SearchHit objects
@return a corresponding object where the SearchHits are replaced by their content if possible, otherwise the
original object | hasNext | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | Apache-2.0 |
@Override
public Object next() {
return unwrapSearchHits(iterator.next());
} | unwraps the data contained in a SearchHit for different types containing SearchHits if possible
@param result the object, list, page or whatever containing SearchHit objects
@return a corresponding object where the SearchHits are replaced by their content if possible, otherwise the
original object | next | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | Apache-2.0 |
@Override
public void close() {
iterator.close();
} | unwraps the data contained in a SearchHit for different types containing SearchHits if possible
@param result the object, list, page or whatever containing SearchHit objects
@return a corresponding object where the SearchHits are replaced by their content if possible, otherwise the
original object | close | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | Apache-2.0 |
public static <T> SearchPage<T> searchPageFor(SearchHits<T> searchHits, @Nullable Pageable pageable) {
return new SearchPageImpl<>(searchHits, (pageable != null) ? pageable : Pageable.unpaged());
} | unwraps the data contained in a SearchHit for different types containing SearchHits if possible
@param result the object, list, page or whatever containing SearchHit objects
@return a corresponding object where the SearchHits are replaced by their content if possible, otherwise the
original object | searchPageFor | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchHitSupport.java | Apache-2.0 |
default long count(Query query, IndexCoordinates index) {
return count(query, null, index);
} | Return number of elements found by given query.
@param query the query to execute
@param index the index to run the query against
@return count | count | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java | Apache-2.0 |
@Nullable
default <T> SearchHit<T> searchOne(Query query, Class<T> clazz) {
List<SearchHit<T>> content = search(query, clazz).getSearchHits();
return content.isEmpty() ? null : content.get(0);
} | Execute the query against elasticsearch and return the first returned object.
@param query the query to execute
@param clazz the entity clazz used for property mapping and indexname extraction
@return the first found object | searchOne | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java | Apache-2.0 |
@Nullable
default <T> SearchHit<T> searchOne(Query query, Class<T> clazz, IndexCoordinates index) {
List<SearchHit<T>> content = search(query, clazz, index).getSearchHits();
return content.isEmpty() ? null : content.get(0);
} | Execute the query against elasticsearch and return the first returned object.
@param query the query to execute
@param clazz the entity clazz used for property mapping
@param index the index to run the query against
@return the first found object | searchOne | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java | Apache-2.0 |
default String openPointInTime(IndexCoordinates index, Duration keepAlive) {
return openPointInTime(index, keepAlive, false);
} | Opens a point in time (pit) in Elasticsearch.
@param index the index name(s) to use
@param keepAlive the duration the pit shoult be kept alive
@return the pit identifier
@since 5.0 | openPointInTime | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/SearchOperations.java | Apache-2.0 |
static <T> SearchHitsIterator<T> streamResults(int maxCount, SearchScrollHits<T> searchHits,
Function<String, SearchScrollHits<T>> continueScrollFunction, Consumer<List<String>> clearScrollConsumer) {
Assert.notNull(searchHits, "searchHits must not be null.");
Assert.notNull(searchHits.getScrollId(), "scrollId ... | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | streamResults | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
@Override
public void close() {
if (!isClosed) {
clearScrollConsumer.accept(scrollState.getScrollIds());
isClosed = true;
}
} | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | close | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
@Override
@Nullable
public AggregationsContainer<?> getAggregations() {
return aggregations;
} | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | getAggregations | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
@Override
public float getMaxScore() {
return maxScore;
} | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | getMaxScore | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
@Override
public Duration getExecutionDuration() {
return executionDuration;
} | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | getExecutionDuration | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
@Override
public long getTotalHits() {
return totalHits;
} | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | getTotalHits | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
@Override
public TotalHitsRelation getTotalHitsRelation() {
return totalHitsRelation;
} | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | getTotalHitsRelation | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
@Override
public boolean hasNext() {
boolean hasNext = false;
if (!isClosed && continueScroll && (maxCount <= 0 || currentCount.get() < maxCount)) {
if (!currentScrollHits.hasNext()) {
SearchScrollHits<T> nextPage = continueScrollFunction.apply(scrollState.getScrollId());
currentScrollHit... | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | hasNext | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
@Override
public SearchHit<T> next() {
if (hasNext()) {
currentCount.incrementAndGet();
return currentScrollHits.next();
}
throw new NoSuchElementException();
} | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | next | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
@Override
public void remove() {
throw new UnsupportedOperationException();
} | Stream query results using {@link SearchScrollHits}.
@param maxCount the maximum number of entities to return, a value of 0 means that all available entities are
returned
@param searchHits the initial hits
@param continueScrollFunction function to continue scrolling applies to the current scrollId.
@param cle... | remove | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/StreamQueries.java | Apache-2.0 |
public String getClusterName() {
return clusterName;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getClusterName | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public String getStatus() {
return status;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getStatus | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
public int getNumberOfNodes() {
return numberOfNodes;
} | Information about the cluster health. Contains currently only the top level elements returned from Elasticsearch.
@author Peter-Josef Meisch
@since 4.2 | getNumberOfNodes | java | spring-projects/spring-data-elasticsearch | src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/cluster/ClusterHealth.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.