DATAES-718 - Deprecate @Score and scoreProperty.

original PR: #374
This commit is contained in:
Peter-Josef Meisch 2020-01-04 22:19:01 +01:00 committed by GitHub
parent 16e0f566cd
commit 9fea1365ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -8,16 +8,21 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.data.annotation.ReadOnlyProperty;
import org.springframework.data.elasticsearch.core.SearchHit;
/**
* Specifies that this field is used for storing the document score.
*
* @author Sascha Woo
* @author Peter-Josef Meisch
* @since 3.1
* @deprecated since 4.0, use {@link SearchHit#getScore()} instead
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
@Documented
@Inherited
@ReadOnlyProperty
public @interface Score {}
@Deprecated
public @interface Score {
}

View File

@ -63,7 +63,9 @@ public interface ElasticsearchPersistentEntity<T> extends PersistentEntity<T, El
*
* @return false when {@link ElasticsearchPersistentEntity} does not define a score property.
* @since 3.1
* @deprecated since 4.0
*/
@Deprecated
boolean hasScoreProperty();
/**
@ -73,7 +75,9 @@ public interface ElasticsearchPersistentEntity<T> extends PersistentEntity<T, El
* @return the score {@link ElasticsearchPersistentProperty} of the {@link PersistentEntity} or {@literal null} if not
* defined.
* @since 3.1
* @deprecated since 4.0
*/
@Nullable
@Deprecated
ElasticsearchPersistentProperty getScoreProperty();
}

View File

@ -16,6 +16,7 @@
package org.springframework.data.elasticsearch.core.mapping;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.elasticsearch.core.SearchHit;
import org.springframework.data.mapping.PersistentProperty;
import org.springframework.lang.Nullable;
@ -46,7 +47,9 @@ public interface ElasticsearchPersistentProperty extends PersistentProperty<Elas
*
* @return
* @since 3.1
* @deprecated since 4.0, use {@link SearchHit#getScore()} instead
*/
@Deprecated
boolean isScoreProperty();
/**