code
stringlengths
25
201k
docstring
stringlengths
19
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
51
path
stringlengths
11
314
url
stringlengths
62
377
license
stringclasses
7 values
public String format(TemporalAccessor accessor) { Assert.notNull(accessor, "accessor must not be null"); if (accessor instanceof Instant instant) { ZonedDateTime zonedDateTime = ZonedDateTime.ofInstant(instant, ZoneId.of("UTC")); return dateFormatter.format(zonedDateTime); } return dateFormatter.format(accessor); }
Formats the given {@link TemporalAccessor} into a String. @param accessor must not be {@literal null} @return the formatted object
format
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
Apache-2.0
public String format(Date date) { Assert.notNull(date, "accessor must not be null"); return dateFormatter.format(Instant.ofEpochMilli(date.getTime())); }
Formats the given {@link TemporalAccessor} int a String @param date must not be {@literal null} @return the formatted object
format
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
Apache-2.0
public <T extends TemporalAccessor> T parse(String input, Class<T> type) { return dateFormatter.parse(input, type); }
Parses a String into a TemporalAccessor. @param input the String to parse, must not be {@literal null}. @param type the class to return @param <T> the class of type @return the new created object
parse
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
Apache-2.0
public Date parse(String input) { return new Date(dateFormatter.parse(input, Instant.class).toEpochMilli()); }
Parses a String into a Date. @param input the String to parse, must not be {@literal null}. @return the new created object
parse
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchDateConverter.java
Apache-2.0
static ElasticsearchTypeMapper create( MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) { return new DefaultElasticsearchTypeMapper(DEFAULT_TYPE_KEY, mappingContext); }
Creates a new default {@link ElasticsearchTypeMapper}. @param mappingContext the mapping context. @return a new default {@link ElasticsearchTypeMapper}. @see DefaultElasticsearchTypeMapper
create
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/ElasticsearchTypeMapper.java
Apache-2.0
static Collection<Converter<?, ?>> getConvertersToRegister() { return Arrays.asList(PointToMapConverter.INSTANCE, MapToPointConverter.INSTANCE, // GeoPointToMapConverter.INSTANCE, MapToGeoPointConverter.INSTANCE, // GeoJsonToMapConverter.INSTANCE, MapToGeoJsonConverter.INSTANCE, // GeoJsonPointToMapConverter.INSTANCE, MapToGeoJsonPointConverter.INSTANCE, // GeoJsonMultiPointToMapConverter.INSTANCE, MapToGeoJsonMultiPointConverter.INSTANCE, // GeoJsonLineStringToMapConverter.INSTANCE, MapToGeoJsonLineStringConverter.INSTANCE, // GeoJsonMultiLineStringToMapConverter.INSTANCE, MapToGeoJsonMultiLineStringConverter.INSTANCE, // GeoJsonPolygonToMapConverter.INSTANCE, MapToGeoJsonPolygonConverter.INSTANCE, // GeoJsonMultiPolygonToMapConverter.INSTANCE, MapToGeoJsonMultiPolygonConverter.INSTANCE, // GeoJsonGeometryCollectionToMapConverter.INSTANCE, MapToGeoJsonGeometryCollectionConverter.INSTANCE); }
Set of {@link Converter converters} specific to Elasticsearch Geo types. @author Christoph Strobl @author Peter-Josef Meisch @since 3.2
getConvertersToRegister
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java
Apache-2.0
@Override public Map<String, Object> convert(Point source) { Map<String, Object> target = new LinkedHashMap<>(); target.put("lat", source.getY()); target.put("lon", source.getX()); return target; }
{@link Converter} to write a {@link Point} to {@link Map} using {@code lat/long} properties.
convert
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java
Apache-2.0
@Override public Point convert(Map<String, Object> source) { Double x = NumberUtils.convertNumberToTargetClass((Number) source.get("lon"), Double.class); Double y = NumberUtils.convertNumberToTargetClass((Number) source.get("lat"), Double.class); return new Point(x, y); }
{@link Converter} to read a {@link Point} from {@link Map} using {@code lat/long} properties.
convert
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/GeoConverters.java
Apache-2.0
@Nullable private Object convertFromCollectionToObject(Object value, Class<?> target) { if (value.getClass().isArray()) { // noinspection ArraysAsListWithZeroOrOneArgument value = Arrays.asList(value); } if (value instanceof Collection<?> collection && !collection.isEmpty()) { value = collection.iterator().next(); } return conversionService.convert(value, target); }
we need the conversion from a collection to the first element for example in the case when reading the constructor parameter of an entity from a scripted return. Originally this was handle in the conversionService, but will be removed from spring-data-commons, so we do it here
convertFromCollectionToObject
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
private <T> void populateScriptedFields(ElasticsearchPersistentEntity<?> entity, T result, SearchDocument searchDocument) { Map<String, List<Object>> fields = searchDocument.getFields(); entity.doWithProperties((SimplePropertyHandler) property -> { if (property.isAnnotationPresent(ScriptedField.class)) { ScriptedField scriptedField = property.findAnnotation(ScriptedField.class); // noinspection ConstantConditions String name = scriptedField.name().isEmpty() ? property.getName() : scriptedField.name(); if (fields.containsKey(name)) { if (property.isCollectionLike()) { List<Object> values = searchDocument.getFieldValues(name); entity.getPropertyAccessor(result).setProperty(property, values); } else { Object value = searchDocument.getFieldValue(name); entity.getPropertyAccessor(result).setProperty(property, value); } } } }); }
Checks if any of the properties of the entity is annotated with @{@link ScriptedField}. If so, the value of this property is set from the returned fields in the document. @param entity the entity to defining the persistent property @param result the rsult to populate @param searchDocument the search result caontaining the fields @param <T> the result type
populateScriptedFields
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
void write(Object source, Document sink) { if (source instanceof Map) { // noinspection unchecked sink.putAll((Map<String, Object>) source); return; } Class<?> entityType = ClassUtils.getUserClass(source.getClass()); ElasticsearchPersistentEntity<?> entity = mappingContext.getPersistentEntity(entityType); if (entity != null) { writeTypeHints = entity.writeTypeHints(); } TypeInformation<?> typeInformation = TypeInformation.of(entityType); if (writeTypeHints && requiresTypeHint(entityType)) { typeMapper.writeType(typeInformation, sink); } writeInternal(source, sink, typeInformation); }
Class to do the actual writing. The methods originally were in the MappingElasticsearchConverter class, but are refactored to allow for keeping state during the conversion of an object.
write
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
@SuppressWarnings("unchecked") private void writeInternal(@Nullable Object source, Map<String, Object> sink, @Nullable TypeInformation<?> typeInformation) { if (null == source) { return; } Class<?> entityType = source.getClass(); Optional<Class<?>> customTarget = conversions.getCustomWriteTarget(entityType, Map.class); if (customTarget.isPresent()) { Map<String, Object> result = conversionService.convert(source, Map.class); if (result != null) { sink.putAll(result); } return; } if (Map.class.isAssignableFrom(entityType)) { writeMapInternal((Map<Object, Object>) source, sink, TypeInformation.MAP); return; } if (Collection.class.isAssignableFrom(entityType)) { writeCollectionInternal((Collection<?>) source, TypeInformation.LIST, (Collection<?>) sink); return; } ElasticsearchPersistentEntity<?> entity = mappingContext.getRequiredPersistentEntity(entityType); addCustomTypeKeyIfNecessary(source, sink, typeInformation); writeInternal(source, sink, entity); }
Internal write conversion method which should be used for nested invocations. @param source the object to write @param sink the destination @param typeInformation type information for the source
writeInternal
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
private void writeInternal(@Nullable Object source, Map<String, Object> sink, @Nullable ElasticsearchPersistentEntity<?> entity) { if (source == null) { return; } if (null == entity) { throw new MappingException("No mapping metadata found for entity of type " + source.getClass().getName()); } PersistentPropertyAccessor<?> accessor = entity.getPropertyAccessor(source); writeProperties(entity, accessor, new MapValueAccessor(sink)); }
Internal write conversion method which should be used for nested invocations. @param source the object to write @param sink the destination @param entity entity for the source
writeInternal
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
private Map<String, Object> writeMapInternal(Map<?, ?> source, Map<String, Object> sink, TypeInformation<?> propertyType) { for (Map.Entry<?, ?> entry : source.entrySet()) { Object key = entry.getKey(); Object value = entry.getValue(); if (isSimpleType(key.getClass())) { String simpleKey = potentiallyConvertMapKey(key); if (value == null || isSimpleType(value)) { sink.put(simpleKey, getPotentiallyConvertedSimpleWrite(value, Object.class)); } else if (value instanceof Collection || value.getClass().isArray()) { sink.put(simpleKey, writeCollectionInternal(asCollection(value), propertyType.getMapValueType(), new ArrayList<>())); } else { Map<String, Object> document = Document.create(); TypeInformation<?> valueTypeInfo = propertyType.isMap() ? propertyType.getMapValueType() : TypeInformation.OBJECT; writeInternal(value, document, valueTypeInfo); sink.put(simpleKey, document); } } else { throw new MappingException("Cannot use a complex object as a key value."); } } return sink; }
Writes the given {@link Map} to the given {@link Document} considering the given {@link TypeInformation}. @param source must not be {@literal null}. @param sink must not be {@literal null}. @param propertyType must not be {@literal null}.
writeMapInternal
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
private void addCustomTypeKeyIfNecessary(Object source, Map<String, Object> sink, @Nullable TypeInformation<?> type) { if (!writeTypeHints) { return; } Class<?> reference; if (type == null) { reference = Object.class; } else { TypeInformation<?> actualType = type.getActualType(); reference = actualType == null ? Object.class : actualType.getType(); } Class<?> valueType = ClassUtils.getUserClass(source.getClass()); boolean notTheSameClass = !valueType.equals(reference); if (notTheSameClass) { typeMapper.writeType(valueType, sink); } }
Adds custom typeInformation information to the given {@link Map} if necessary. That is if the value is not the same as the one given. This is usually the case if you store a subtype of the actual declared typeInformation of the property. @param source must not be {@literal null}. @param sink must not be {@literal null}. @param type type to compare to
addCustomTypeKeyIfNecessary
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
private String potentiallyConvertMapKey(Object key) { if (key instanceof String) { return (String) key; } if (conversions.hasCustomWriteTarget(key.getClass(), String.class)) { Object potentiallyConvertedSimpleWrite = getPotentiallyConvertedSimpleWrite(key, Object.class); if (potentiallyConvertedSimpleWrite == null) { return key.toString(); } return (String) potentiallyConvertedSimpleWrite; } return key.toString(); }
Returns a {@link String} representation of the given {@link Map} key @param key the key to convert
potentiallyConvertMapKey
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
protected List<Object> createCollection(Collection<?> collection, ElasticsearchPersistentProperty property) { return writeCollectionInternal(collection, property.getTypeInformation(), new ArrayList<>(collection.size())); }
Writes the given {@link Collection} using the given {@link ElasticsearchPersistentProperty} information. @param collection must not be {@literal null}. @param property must not be {@literal null}.
createCollection
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
protected Map<String, Object> createMap(Map<?, ?> map, ElasticsearchPersistentProperty property) { Assert.notNull(map, "Given map must not be null!"); Assert.notNull(property, "PersistentProperty must not be null!"); return writeMapInternal(map, new LinkedHashMap<>(map.size()), property.getTypeInformation()); }
Writes the given {@link Map} using the given {@link ElasticsearchPersistentProperty} information. @param map must not {@literal null}. @param property must not be {@literal null}.
createMap
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
private void updatePropertiesInFieldsSortAndSourceFilter(Query query, Class<?> domainClass) { ElasticsearchPersistentEntity<?> persistentEntity = mappingContext.getPersistentEntity(domainClass); if (persistentEntity != null) { List<String> fields = query.getFields(); if (!fields.isEmpty()) { query.setFields(propertyToFieldNames(fields, persistentEntity)); } List<String> storedFields = query.getStoredFields(); if (!CollectionUtils.isEmpty(storedFields)) { query.setStoredFields(propertyToFieldNames(storedFields, persistentEntity)); } SourceFilter sourceFilter = query.getSourceFilter(); if (sourceFilter != null) { String[] includes = null; String[] excludes = null; if (sourceFilter.getIncludes() != null) { includes = propertyToFieldNames(Arrays.asList(sourceFilter.getIncludes()), persistentEntity) .toArray(new String[] {}); } if (sourceFilter.getExcludes() != null) { excludes = propertyToFieldNames(Arrays.asList(sourceFilter.getExcludes()), persistentEntity) .toArray(new String[] {}); } query.addSourceFilter(new FetchSourceFilter(sourceFilter.fetchSource(), includes, excludes)); } if (query.getSort() != null) { var sort = query.getSort(); // stream the orders and map them to a new order with the changed names, // then replace the existing sort with a new sort containing the new orders. var newOrders = sort.stream().map(order -> { var fieldNames = updateFieldNames(order.getProperty(), persistentEntity); if (order instanceof Order springDataElasticsearchOrder) { return springDataElasticsearchOrder.withProperty(fieldNames); } else { return new Sort.Order(order.getDirection(), fieldNames, order.isIgnoreCase(), order.getNullHandling()); } }).toList(); if (query instanceof BaseQuery baseQuery) { baseQuery.setSort(Sort.by(newOrders)); } } } }
replaces the names of fields in the query, the sort or soucre filters with the field names used in Elasticsearch when they are defined on the ElasticsearchProperties @param query the query to process @param domainClass the domain class (persistent entity)
updatePropertiesInFieldsSortAndSourceFilter
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/convert/MappingElasticsearchConverter.java
Apache-2.0
static Document create() { return new MapDocument(); }
Create a new mutable {@link Document}. @return a new {@link Document}.
create
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
static Document from(Map<String, ?> map) { Assert.notNull(map, "Map must not be null"); if (map instanceof LinkedHashMap) { return new MapDocument(map); } return new MapDocument(new LinkedHashMap<>(map)); }
Create a {@link Document} from a {@link Map} containing key-value pairs and sub-documents. @param map source map containing key-value pairs and sub-documents. must not be {@literal null}. @return a new {@link Document}.
from
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default boolean hasId() { return false; }
Return {@literal true} if this {@link Document} is associated with an identifier. @return {@literal true} if this {@link Document} is associated with an identifier, {@literal false} otherwise.
hasId
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
@Nullable default String getIndex() { return null; }
@return the index if this document was retrieved from an index or was just stored. @since 4.1
getIndex
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default void setIndex(@Nullable String index) { throw new UnsupportedOperationException(); }
Sets the index name for this document @param index index name <p> The default implementation throws {@link UnsupportedOperationException}. @since 4.1
setIndex
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default String getId() { throw new UnsupportedOperationException(); }
Retrieve the identifier associated with this {@link Document}. <p> The default implementation throws {@link UnsupportedOperationException}. It's recommended to check {@link #hasId()} prior to calling this method. @return the identifier associated with this {@link Document}. @throws IllegalStateException if the underlying implementation supports Id's but no Id was yet associated with the document.
getId
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default void setId(String id) { throw new UnsupportedOperationException(); }
Set the identifier for this {@link Document}. <p> The default implementation throws {@link UnsupportedOperationException}.
setId
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default boolean hasVersion() { return false; }
Return {@literal true} if this {@link Document} is associated with a version. @return {@literal true} if this {@link Document} is associated with a version, {@literal false} otherwise.
hasVersion
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default long getVersion() { throw new UnsupportedOperationException(); }
Retrieve the version associated with this {@link Document}. <p> The default implementation throws {@link UnsupportedOperationException}. It's recommended to check {@link #hasVersion()} prior to calling this method. @return the version associated with this {@link Document}. @throws IllegalStateException if the underlying implementation supports Id's but no Id was yet associated with the document.
getVersion
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default void setVersion(long version) { throw new UnsupportedOperationException(); }
Set the version for this {@link Document}. <p> The default implementation throws {@link UnsupportedOperationException}.
setVersion
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default boolean hasSeqNo() { return false; }
Return {@literal true} if this {@link Document} is associated with a seq_no. @return {@literal true} if this {@link Document} is associated with a seq_no, {@literal false} otherwise.
hasSeqNo
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default long getSeqNo() { throw new UnsupportedOperationException(); }
Retrieve the seq_no associated with this {@link Document}. <p> The default implementation throws {@link UnsupportedOperationException}. It's recommended to check {@link #hasSeqNo()} prior to calling this method. @return the seq_no associated with this {@link Document}. @throws IllegalStateException if the underlying implementation supports seq_no's but no seq_no was yet associated with the document.
getSeqNo
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default void setSeqNo(long seqNo) { throw new UnsupportedOperationException(); }
Set the seq_no for this {@link Document}. <p> The default implementation throws {@link UnsupportedOperationException}.
setSeqNo
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default boolean hasPrimaryTerm() { return false; }
Return {@literal true} if this {@link Document} is associated with a primary_term. @return {@literal true} if this {@link Document} is associated with a primary_term, {@literal false} otherwise.
hasPrimaryTerm
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default long getPrimaryTerm() { throw new UnsupportedOperationException(); }
Retrieve the primary_term associated with this {@link Document}. <p> The default implementation throws {@link UnsupportedOperationException}. It's recommended to check {@link #hasPrimaryTerm()} prior to calling this method. @return the primary_term associated with this {@link Document}. @throws IllegalStateException if the underlying implementation supports primary_term's but no primary_term was yet associated with the document.
getPrimaryTerm
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default void setPrimaryTerm(long primaryTerm) { throw new UnsupportedOperationException(); }
Set the primary_term for this {@link Document}. <p> The default implementation throws {@link UnsupportedOperationException}.
setPrimaryTerm
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
default <R> R transform(Function<? super Document, ? extends R> transformer) { Assert.notNull(transformer, "transformer must not be null"); return transformer.apply(this); }
This method allows the application of a function to {@code this} {@link Document}. The function should expect a single {@link Document} argument and produce an {@code R} result. <p> Any exception thrown by the function will be propagated to the caller. @param transformer functional interface to a apply. must not be {@literal null}. @param <R> class of the result @return the result of applying the function to this string @see java.util.function.Function
transform
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/Document.java
Apache-2.0
@Nullable default <V> V getFieldValue(final String name) { List<Object> values = getFields().get(name); if (values == null || values.isEmpty()) { return null; } return (V) values.get(0); }
The first value of the given field. @param name the field name
getFieldValue
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
Apache-2.0
@Nullable default <V> List<V> getFieldValues(final String name) { List<Object> values = getFields().get(name); if (values == null) { return null; } return (List<V>) values; }
@param name the field name @param <V> the type of elements @return the values of the given field.
getFieldValues
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
Apache-2.0
@Nullable default Object[] getSortValues() { return null; }
@return the sort values for the search hit
getSortValues
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
Apache-2.0
@Nullable default Map<String, List<String>> getHighlightFields() { return null; }
@return the highlightFields for the search hit.
getHighlightFields
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
Apache-2.0
@Nullable default Map<String, SearchDocumentResponse> getInnerHits() { return null; }
@return the innerHits for the SearchHit @since 4.1
getInnerHits
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
Apache-2.0
@Nullable default NestedMetaData getNestedMetaData() { return null; }
@return the nested metadata in case this is a nested inner hit. @since 4.1
getNestedMetaData
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
Apache-2.0
@Nullable default String getRouting() { return getFieldValue("_routing"); }
@return the routing value for the document @since 4.2
getRouting
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/document/SearchDocument.java
Apache-2.0
public static GeoBox fromBox(Box box) { GeoPoint topLeft = GeoPoint.fromPoint(box.getFirst()); GeoPoint bottomRight = GeoPoint.fromPoint(box.getSecond()); return new GeoBox(topLeft, bottomRight); }
return a {@link org.springframework.data.elasticsearch.core.geo.GeoBox} from a {@link org.springframework.data.geo.Box}. @param box {@link org.springframework.data.geo.Box} to use @return a {@link org.springframework.data.elasticsearch.core.geo.GeoBox}
fromBox
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoBox.java
Apache-2.0
static GeoJson<?> of(String json) { return GeoConverters.MapToGeoJsonConverter.INSTANCE.convert(Document.parse(json)); }
@param json the JSON string to parse @return the parsed {@link GeoJson} object @throws ConversionException on parse erros
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java
Apache-2.0
default String toJson() { return Document.from(GeoConverters.GeoJsonToMapConverter.INSTANCE.convert(this)).toJson(); }
@return a JSON representation of this object
toJson
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJson.java
Apache-2.0
public static GeoJsonLineString of(List<Point> points) { Assert.notNull(points, "Points must not be null."); Assert.isTrue(points.size() >= 2, "Minimum of 2 Points required."); return new GeoJsonLineString(points); }
Creates a new {@link GeoJsonLineString} for the given {@link Point}s. @param points points must not be {@literal null} and have at least 2 entries.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java
Apache-2.0
public static GeoJsonLineString of(Point first, Point second, Point... others) { Assert.notNull(first, "First point must not be null!"); Assert.notNull(second, "Second point must not be null!"); Assert.notNull(others, "Additional points must not be null!"); List<Point> points = new ArrayList<>(2 + others.length); points.add(first); points.add(second); points.addAll(Arrays.asList(others)); return new GeoJsonLineString(points); }
Creates a new {@link GeoJsonLineString} for the given {@link Point}s. @param first must not be {@literal null}. @param second must not be {@literal null}. @param others must not be {@literal null}.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java
Apache-2.0
public static GeoJsonLineString ofGeoPoints(List<GeoPoint> geoPoints) { Assert.notNull(geoPoints, "Points must not be null."); Assert.isTrue(geoPoints.size() >= 2, "Minimum of 2 Points required."); return new GeoJsonLineString(geoPoints.stream().map(GeoPoint::toPoint).collect(Collectors.toList())); }
Creates a new {@link GeoJsonLineString} for the given {@link GeoPoint}s. @param geoPoints geoPoints must not be {@literal null} and have at least 2 entries.
ofGeoPoints
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonLineString.java
Apache-2.0
public static GeoJsonMultiLineString of(List<GeoJsonLineString> lines) { Assert.notNull(lines, "Lines for MultiLineString must not be null!"); return new GeoJsonMultiLineString(lines); }
Creates new {@link GeoJsonMultiLineString} for the given {@link GeoJsonLineString}s. @param lines must not be {@literal null}.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineString.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiLineString.java
Apache-2.0
public static GeoJsonMultiPoint of(List<Point> points) { Assert.notNull(points, "Points must not be null."); Assert.isTrue(points.size() >= 2, "Minimum of 2 Points required."); return new GeoJsonMultiPoint(points); }
Creates a new {@link GeoJsonMultiPoint} for the given {@link Point}s. @param points points must not be {@literal null} and have at least 2 entries.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java
Apache-2.0
public static GeoJsonMultiPoint of(Point first, Point second, Point... others) { Assert.notNull(first, "First point must not be null!"); Assert.notNull(second, "Second point must not be null!"); Assert.notNull(others, "Additional points must not be null!"); List<Point> points = new ArrayList<>(2 + others.length); points.add(first); points.add(second); points.addAll(Arrays.asList(others)); return new GeoJsonMultiPoint(points); }
Creates a new {@link GeoJsonMultiPoint} for the given {@link Point}s. @param first must not be {@literal null}. @param second must not be {@literal null}. @param others must not be {@literal null}.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java
Apache-2.0
public static GeoJsonMultiPoint ofGeoPoints(List<GeoPoint> geoPoints) { Assert.notNull(geoPoints, "Points must not be null."); Assert.isTrue(geoPoints.size() >= 2, "Minimum of 2 Points required."); return new GeoJsonMultiPoint(geoPoints.stream().map(GeoPoint::toPoint).collect(Collectors.toList())); }
Creates a new {@link GeoJsonMultiPoint} for the given {@link GeoPoint}s. @param geoPoints geoPoints must not be {@literal null} and have at least 2 entries.
ofGeoPoints
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonMultiPoint.java
Apache-2.0
public static GeoJsonPoint of(double x, double y) { return new GeoJsonPoint(x, y); }
Creates {@link GeoJsonPoint} for given coordinates. @param x @param y
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPoint.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPoint.java
Apache-2.0
public static GeoJsonPoint of(Point point) { return new GeoJsonPoint(point.getX(), point.getY()); }
Creates {@link GeoJsonPoint} for given {@link Point}. @param point must not be {@literal null}.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPoint.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPoint.java
Apache-2.0
public static GeoJsonPolygon of(GeoJsonLineString geoJsonLineString) { return new GeoJsonPolygon(geoJsonLineString); }
Creates new {@link GeoJsonPolygon} from the given {@link GeoJsonLineString}. @param geoJsonLineString must not be {@literal null}.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
Apache-2.0
public static GeoJsonPolygon of(List<Point> points) { return new GeoJsonPolygon(points); }
Creates new {@link GeoJsonPolygon} from the given {@link Point}s. @param points must not be {@literal null}.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
Apache-2.0
public static GeoJsonPolygon ofGeoPoints(List<GeoPoint> geoPoints) { return new GeoJsonPolygon(GeoJsonLineString.ofGeoPoints(geoPoints)); }
Creates new {@link GeoJsonPolygon} from the given {@link GeoPoint}s. @param geoPoints must not be {@literal null}.
ofGeoPoints
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
Apache-2.0
public static GeoJsonPolygon of(Point first, Point second, Point third, Point fourth, Point... others) { return new GeoJsonPolygon(asList(first, second, third, fourth, others)); }
Creates new {@link GeoJsonPolygon} from the given {@link Point}s. @param first must not be {@literal null}. @param second must not be {@literal null}. @param third must not be {@literal null}. @param fourth must not be {@literal null} @param others can be empty.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
Apache-2.0
public static GeoJsonPolygon of(GeoPoint first, GeoPoint second, GeoPoint third, GeoPoint fourth, GeoPoint... others) { return new GeoJsonPolygon(GeoJsonLineString.ofGeoPoints(asList(first, second, third, fourth, others))); }
Creates new {@link GeoJsonPolygon} from the given {@link GeoPoint}s. @param first must not be {@literal null}. @param second must not be {@literal null}. @param third must not be {@literal null}. @param fourth must not be {@literal null} @param others can be empty.
of
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
Apache-2.0
public GeoJsonPolygon withInnerRing(Point first, Point second, Point third, Point fourth, Point... others) { return withInnerRing(asList(first, second, third, fourth, others)); }
Creates a new {@link GeoJsonPolygon} with an inner ring defined be the given {@link Point}s. @param first must not be {@literal null}. @param second must not be {@literal null}. @param third must not be {@literal null}. @param fourth must not be {@literal null}. @param others can be empty. @return new {@link GeoJsonPolygon}.
withInnerRing
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
Apache-2.0
public GeoJsonPolygon withInnerRing(GeoPoint first, GeoPoint second, GeoPoint third, GeoPoint fourth, GeoPoint... others) { return withInnerRingOfGeoPoints(asList(first, second, third, fourth, others)); }
Creates a new {@link GeoJsonPolygon} with an inner ring defined be the given {@link GeoPoint}s. @param first must not be {@literal null}. @param second must not be {@literal null}. @param third must not be {@literal null}. @param fourth must not be {@literal null}. @param others can be empty. @return new {@link GeoJsonPolygon}.
withInnerRing
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
Apache-2.0
public GeoJsonPolygon withInnerRing(List<Point> points) { return withInnerRing(GeoJsonLineString.of(points)); }
Creates a new {@link GeoJsonPolygon} with an inner ring defined be the given {@link List} of {@link Point}s. @param points must not be {@literal null}. @return new {@link GeoJsonPolygon}.
withInnerRing
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
Apache-2.0
public GeoJsonPolygon withInnerRingOfGeoPoints(List<GeoPoint> geoPoints) { return withInnerRing(GeoJsonLineString.ofGeoPoints(geoPoints)); }
Creates a new {@link GeoJsonPolygon} with an inner ring defined be the given {@link List} of {@link GeoPoint}s. @param geoPoints must not be {@literal null}. @return new {@link GeoJsonPolygon}.
withInnerRingOfGeoPoints
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/geo/GeoJsonPolygon.java
Apache-2.0
public AliasActionParameters getParameters() { return parameters; }
A single action to be contained in {@link AliasActions}. @author Peter-Josef Meisch @since 4.1
getParameters
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/index/AliasAction.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/index/AliasAction.java
Apache-2.0
public static Builder builder() { return new Builder(); }
Value class capturing the arguments for an {@link AliasAction}. @author Peter-Josef Meisch @since 4.1
builder
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActionParameters.java
Apache-2.0
public List<AliasAction> getActions() { return Collections.unmodifiableList(actions); }
Creates an {@link AliasActions} object with the passed in action elements. @param actions {@link AliasAction} elements
getActions
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java
Apache-2.0
public AliasActions add(@Nullable AliasAction... actions) { if (actions != null) { this.actions.addAll(Arrays.asList(actions)); } return this; }
Adds {@link AliasAction} elements to this {@link AliasActions} @param actions elements to add @return this object
add
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/index/AliasActions.java
Apache-2.0
private String getMappedTypeName(Field field) { return StringUtils.hasText(field.mappedTypeName()) ? field.mappedTypeName() : field.type().getMappedName(); }
Return the mapping type name to be used for the {@link Field} @param field field to return the mapping type name for @return the mapping type name
getMappedTypeName
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/index/MappingBuilder.java
Apache-2.0
public void writeTypeAndParametersTo(ObjectNode objectNode) throws IOException { Assert.notNull(objectNode, "objectNode must not be null"); if (fielddata) { objectNode.put(FIELD_PARAM_DATA, fielddata); } if (type != FieldType.Auto) { objectNode.put(FIELD_PARAM_TYPE, mappedTypeName); if (type == FieldType.Date || type == FieldType.Date_Nanos || type == FieldType.Date_Range) { List<String> formats = new ArrayList<>(); // built-in formats for (DateFormat dateFormat : dateFormats) { formats.add(dateFormat.toString()); } // custom date formats Collections.addAll(formats, dateFormatPatterns); if (!formats.isEmpty()) { objectNode.put(FIELD_PARAM_FORMAT, String.join("||", formats)); } } } if (!index) { objectNode.put(FIELD_PARAM_INDEX, index); } if (StringUtils.hasLength(analyzer)) { objectNode.put(FIELD_PARAM_INDEX_ANALYZER, analyzer); } if (StringUtils.hasLength(searchAnalyzer)) { objectNode.put(FIELD_PARAM_SEARCH_ANALYZER, searchAnalyzer); } if (StringUtils.hasLength(normalizer)) { objectNode.put(FIELD_PARAM_NORMALIZER, normalizer); } if (copyTo != null && copyTo.length > 0) { objectNode.putArray(FIELD_PARAM_COPY_TO) .addAll(Arrays.stream(copyTo).map(TextNode::valueOf).collect(Collectors.toList())); } if (ignoreAbove != null) { Assert.isTrue(ignoreAbove >= 0, "ignore_above must be a positive value"); objectNode.put(FIELD_PARAM_IGNORE_ABOVE, ignoreAbove); } if (!coerce) { objectNode.put(FIELD_PARAM_COERCE, coerce); } if (!docValues) { objectNode.put(FIELD_PARAM_DOC_VALUES, docValues); } if (ignoreMalformed) { objectNode.put(FIELD_PARAM_IGNORE_MALFORMED, ignoreMalformed); } if (indexOptions != IndexOptions.none) { objectNode.put(FIELD_PARAM_INDEX_OPTIONS, indexOptions.toString()); } if (indexPhrases) { objectNode.put(FIELD_PARAM_INDEX_PHRASES, indexPhrases); } if (indexPrefixes != null) { ObjectNode prefixNode = objectNode.putObject(FIELD_PARAM_INDEX_PREFIXES); if (indexPrefixes.minChars() != IndexPrefixes.MIN_DEFAULT) { prefixNode.put(FIELD_PARAM_INDEX_PREFIXES_MIN_CHARS, indexPrefixes.minChars()); } if (indexPrefixes.maxChars() != IndexPrefixes.MAX_DEFAULT) { prefixNode.put(FIELD_PARAM_INDEX_PREFIXES_MAX_CHARS, indexPrefixes.maxChars()); } } if (!norms) { objectNode.put(FIELD_PARAM_NORMS, norms); } if (StringUtils.hasLength(nullValue)) { switch (nullValueType) { case Integer -> objectNode.put(FIELD_PARAM_NULL_VALUE, Integer.valueOf(nullValue)); case Long -> objectNode.put(FIELD_PARAM_NULL_VALUE, Long.valueOf(nullValue)); case Double -> objectNode.put(FIELD_PARAM_NULL_VALUE, Double.valueOf(nullValue)); case String -> objectNode.put(FIELD_PARAM_NULL_VALUE, nullValue); default -> objectNode.put(FIELD_PARAM_NULL_VALUE, nullValue); } } if (positionIncrementGap != null && positionIncrementGap >= 0) { objectNode.put(FIELD_PARAM_POSITION_INCREMENT_GAP, positionIncrementGap); } if (!Similarity.Default.equals(similarity)) { objectNode.put(FIELD_PARAM_SIMILARITY, similarity); // similarity must have index explicitly set, otherwise Elasticsearch returns an error objectNode.put(FIELD_PARAM_INDEX, index); } if (termVector != TermVector.none) { objectNode.put(FIELD_PARAM_TERM_VECTOR, termVector.toString()); } if (type == FieldType.Scaled_Float) { objectNode.put(FIELD_PARAM_SCALING_FACTOR, scalingFactor); } if (maxShingleSize != null) { objectNode.put(FIELD_PARAM_MAX_SHINGLE_SIZE, maxShingleSize); } if (!positiveScoreImpact) { objectNode.put(FIELD_PARAM_POSITIVE_SCORE_IMPACT, positiveScoreImpact); } if (type == FieldType.Dense_Vector) { objectNode.put(FIELD_PARAM_DIMS, dims); if (!FieldElementType.DEFAULT.equals(elementType)) { objectNode.put(FIELD_PARAM_ELEMENT_TYPE, elementType); } if (knnSimilarity != KnnSimilarity.DEFAULT) { objectNode.put(FIELD_PARAM_SIMILARITY, knnSimilarity.getSimilarity()); } if (knnSimilarity != KnnSimilarity.DEFAULT) { Assert.isTrue(index, "knn similarity can only be specified when 'index' is true."); objectNode.put(FIELD_PARAM_SIMILARITY, knnSimilarity.getSimilarity()); } if (knnIndexOptions != null) { Assert.isTrue(index, "knn index options can only be specified when 'index' is true."); ObjectNode indexOptionsNode = objectNode.putObject(FIELD_PARAM_INDEX_OPTIONS); KnnAlgorithmType algoType = knnIndexOptions.type(); if (algoType != KnnAlgorithmType.DEFAULT) { if (algoType == KnnAlgorithmType.INT8_HNSW || algoType == KnnAlgorithmType.INT8_FLAT) { Assert.isTrue(!FieldElementType.BYTE.equals(elementType), "'element_type' can only be float when using vector quantization."); } indexOptionsNode.put(FIELD_PARAM_TYPE, algoType.getType()); } if (knnIndexOptions.m() >= 0) { Assert.isTrue(algoType == KnnAlgorithmType.HNSW || algoType == KnnAlgorithmType.INT8_HNSW, "knn 'm' parameter can only be applicable to hnsw and int8_hnsw index types."); indexOptionsNode.put(FIELD_PARAM_M, knnIndexOptions.m()); } if (knnIndexOptions.efConstruction() >= 0) { Assert.isTrue(algoType == KnnAlgorithmType.HNSW || algoType == KnnAlgorithmType.INT8_HNSW, "knn 'ef_construction' can only be applicable to hnsw and int8_hnsw index types."); indexOptionsNode.put(FIELD_PARAM_EF_CONSTRUCTION, knnIndexOptions.efConstruction()); } if (knnIndexOptions.confidenceInterval() >= 0) { Assert.isTrue(algoType == KnnAlgorithmType.INT8_HNSW || algoType == KnnAlgorithmType.INT8_FLAT, "knn 'confidence_interval' can only be applicable to int8_hnsw and int8_flat index types."); indexOptionsNode.put(FIELD_PARAM_CONFIDENCE_INTERVAL, knnIndexOptions.confidenceInterval()); } } } if (!enabled) { objectNode.put(FIELD_PARAM_ENABLED, enabled); } if (eagerGlobalOrdinals) { objectNode.put(FIELD_PARAM_EAGER_GLOBAL_ORDINALS, eagerGlobalOrdinals); } }
writes the different fields to an {@link ObjectNode}. @param objectNode must not be {@literal null}
writeTypeAndParametersTo
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/index/MappingParameters.java
Apache-2.0
public Settings flatten() { return new Settings( // entrySet().stream() // .flatMap(Settings::doFlatten) // .collect(Collectors.toMap(Entry::getKey, Entry::getValue))); // }
flattens the nested structure (JSON fields index/foo/bar/: value) into a flat structure (index.foo.bar: value) @return Settings with the flattened elements.
flatten
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/index/Settings.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/index/Settings.java
Apache-2.0
static private Stream<Map.Entry<String, Object>> doFlatten(Map.Entry<String, Object> entry) { if (entry.getValue()instanceof Map<?, ?> nested) { // noinspection unchecked return nested.entrySet().stream() // .map(e -> new AbstractMap.SimpleEntry<>(entry.getKey() + "." + e.getKey(), e.getValue())) .flatMap(e2 -> doFlatten((Entry<String, Object>) e2)); } else { return Stream.of(entry); } }
flattens a Map<String, Object> to a stream of Map.Entry objects where the keys are the dot separated concatenated keys of sub map entries
doFlatten
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/index/Settings.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/index/Settings.java
Apache-2.0
public Builder withIndexRouting(@Nullable String indexRouting) { if (indexRouting != null && !indexRouting.trim().isEmpty()) { this.indexRouting = indexRouting; } return this; }
Used to route indexing operations to a specific shard.
withIndexRouting
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java
Apache-2.0
public Builder withSearchRouting(@Nullable String searchRouting) { if (searchRouting != null && !searchRouting.trim().isEmpty()) { this.searchRouting = searchRouting; } return this; }
Used to route search operations to a specific shard.
withSearchRouting
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java
Apache-2.0
public Builder withRouting(@Nullable String routing) { if (routing != null && !routing.trim().isEmpty()) { this.routing = routing; } return this; }
Used to route indexing and search operations to a specific shard.
withRouting
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java
Apache-2.0
public Builder withHidden(@Nullable Boolean hidden) { isHidden = hidden; return this; }
The alias is hidden? By default, this is set to {@code false}.
withHidden
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/Alias.java
Apache-2.0
default ElasticsearchPersistentProperty getRequiredSeqNoPrimaryTermProperty() { ElasticsearchPersistentProperty property = this.getSeqNoPrimaryTermProperty(); if (property != null) { return property; } else { throw new IllegalStateException( String.format("Required SeqNoPrimaryTerm property not found for %s!", this.getType())); } }
Returns the {@link SeqNoPrimaryTerm} property of the {@link ElasticsearchPersistentEntity} or throws an IllegalStateException in case no such property is available on the entity. @return the {@link SeqNoPrimaryTerm} {@link ElasticsearchPersistentProperty} of the {@link PersistentEntity}. @since 4.0
getRequiredSeqNoPrimaryTermProperty
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentEntity.java
Apache-2.0
@Override public String convert(ElasticsearchPersistentProperty source) { return source.getName(); }
when building CriteriaQueries use the name; the fieldname is set later with {@link org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter}.
convert
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/ElasticsearchPersistentProperty.java
Apache-2.0
public void setFieldNamingStrategy(@Nullable FieldNamingStrategy fieldNamingStrategy) { this.fieldNamingStrategy = fieldNamingStrategy == null ? DEFAULT_NAMING_STRATEGY : fieldNamingStrategy; }
Configures the {@link FieldNamingStrategy} to be used to determine the field name if no manual mapping is applied. Defaults to a strategy using the plain property name. @param fieldNamingStrategy the {@link FieldNamingStrategy} to be used to determine the field name if no manual mapping is applied. @since 4.2
setFieldNamingStrategy
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchMappingContext.java
Apache-2.0
private IndexCoordinates resolve(IndexCoordinates indexCoordinates) { String[] indexNames = indexCoordinates.getIndexNames(); String[] resolvedNames = new String[indexNames.length]; for (int i = 0; i < indexNames.length; i++) { String indexName = indexNames[i]; resolvedNames[i] = resolve(indexName); } return IndexCoordinates.of(resolvedNames); }
resolves all the names in the IndexCoordinates object. If a name cannot be resolved, the original name is returned. @param indexCoordinates IndexCoordinates with names to resolve @return IndexCoordinates with resolved names
resolve
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
Apache-2.0
private String resolve(String name) { Assert.notNull(name, "name must not be null"); Expression expression = getExpressionForIndexName(name); String resolvedName = expression != null ? expression.getValue(indexNameEvaluationContext.get(), String.class) : null; return resolvedName != null ? resolvedName : name; }
tries to resolve the given name. If this is not successful, the original value is returned @param name name to resolve @return the resolved name or the input name if it cannot be resolved
resolve
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
Apache-2.0
@Nullable private Expression getExpressionForIndexName(String name) { return indexNameExpressions.computeIfAbsent(name, s -> { Expression expr = PARSER.parseExpression(s, ParserContext.TEMPLATE_EXPRESSION); return expr instanceof LiteralExpression ? null : expr; }); }
returns an {@link Expression} for #name if name contains a {@link ParserContext#TEMPLATE_EXPRESSION} otherwise returns {@literal null}. @param name the name to get the expression for @return Expression may be null
getExpressionForIndexName
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
Apache-2.0
Settings toSettings() { if (useServerConfiguration) { return new Settings(); } var index = new Settings() // .append("number_of_shards", String.valueOf(shards)) // .append("number_of_replicas", String.valueOf(replicas)); if (refreshIntervall != null) { index.append("refresh_interval", refreshIntervall); } if (indexStoreType != null && !"fs".equals(indexStoreType)) { index.append("store", new Settings().append("type", indexStoreType)); } if (sortFields != null && sortFields.length > 0) { var sort = new Settings().append("field", sortFields); if (sortOrders != null && sortOrders.length > 0) { sort.append("order", sortOrders); } if (sortModes != null && sortModes.length > 0) { sort.append("mode", sortModes); } if (sortMissingValues != null && sortMissingValues.length > 0) { sort.append("missing", sortMissingValues); } index.append("sort", sort); } return new Settings().append("index", index); // }
internal class to collect settings values from the {@link Document} and {@link Setting} annotations-
toSettings
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
Apache-2.0
private void buildAliases() { // Clear the existing aliases. aliases.clear(); if (document != null) { for (org.springframework.data.elasticsearch.annotations.Alias alias : document.aliases()) { if (alias.value().isEmpty()) { continue; } Query query = null; if (!alias.filter().value().isEmpty()) { query = new StringQuery(alias.filter().value()); } aliases.add( Alias.builder(alias.value()) .withFilter(query) .withIndexRouting(alias.indexRouting()) .withSearchRouting(alias.searchRouting()) .withRouting(alias.routing()) .withHidden(alias.isHidden()) .withWriteIndex(alias.isWriteIndex()) .build()); } } }
Building once the aliases for the current document.
buildAliases
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/mapping/SimpleElasticsearchPersistentEntity.java
Apache-2.0
public static BulkOptionsBuilder builder() { return new BulkOptionsBuilder(); }
Create a new {@link BulkOptionsBuilder} to build {@link BulkOptions}. @return a new {@link BulkOptionsBuilder} to build {@link BulkOptions}.
builder
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java
Apache-2.0
public static BulkOptions defaultOptions() { return defaultOptions; }
Return default {@link BulkOptions}. @return default {@link BulkOptions}.
defaultOptions
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/BulkOptions.java
Apache-2.0
@Nullable public String getReasonCancelled() { return reasonCancelled; }
The reason that the request was canceled or null if it hasn't been.
getReasonCancelled
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java
Apache-2.0
public static FailureBuilder builder() { return new FailureBuilder(); }
Create a new {@link FailureBuilder} to build {@link Failure} @return a new {@link FailureBuilder} to build {@link Failure}
builder
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java
Apache-2.0
public static SearchFailureBuilder builder() { return new SearchFailureBuilder(); }
Create a new {@link SearchFailureBuilder} to build {@link SearchFailure} @return a new {@link SearchFailureBuilder} to build {@link SearchFailure}
builder
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/ByQueryResponse.java
Apache-2.0
public static Criteria and() { return new Criteria(); }
@return factory method to create an and-Criteria that is not bound to a field @since 4.1
and
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public static Criteria or() { return new OrCriteria(); }
@return factory method to create an or-Criteria that is not bound to a field @since 4.1
or
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public static Criteria where(String fieldName) { return new Criteria(fieldName); }
Static factory method to create a new Criteria for field with given name @param fieldName field to create the Criteria for
where
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public static Criteria where(Field field) { return new Criteria(field); }
Static factory method to create a new Criteria for provided field @param field field to create the Criteria for
where
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public Set<Criteria> getSubCriteria() { return subCriteria; }
@return the set ob subCriteria @since 4.1
getSubCriteria
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public Criteria and(Field field) { return new Criteria(criteriaChain, field); }
Chain a new and-Criteria @param field the field for the new Criteria @return the new chained Criteria
and
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public Criteria and(String fieldName) { return new Criteria(criteriaChain, fieldName); }
Chain a new and- Criteria @param fieldName the field for the new Criteria @return the new chained Criteria
and
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public Criteria and(Criteria criteria) { Assert.notNull(criteria, "Cannot chain 'null' criteria."); this.criteriaChain.add(criteria); return this; }
Chain a Criteria to this object. @param criteria the Criteria to add @return this object
and
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public Criteria and(Criteria... criterias) { Assert.notNull(criterias, "Cannot chain 'null' criterias."); this.criteriaChain.addAll(Arrays.asList(criterias)); return this; }
Chain an array of Criteria to this object. @param criterias the Criteria to add @return this object
and
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public Criteria or(Field field) { return new OrCriteria(this.criteriaChain, field); }
Chain a new or-Criteria @param field the field for the new Criteria @return the new chained Criteria
or
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0
public Criteria or(String fieldName) { return or(new SimpleField(fieldName)); }
Chain a new or-Criteria @param fieldName the field for the new Criteria @return the new chained Criteria
or
java
spring-projects/spring-data-elasticsearch
src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/main/java/org/springframework/data/elasticsearch/core/query/Criteria.java
Apache-2.0