Skip to content

Commit 2882b00

Browse files
committed
HSEARCH-**** Remove methods that aren't "addressed" yet
1 parent bed4edd commit 2882b00

File tree

2 files changed

+16
-109
lines changed

2 files changed

+16
-109
lines changed

engine/src/main/java/org/hibernate/search/engine/search/sort/dsl/SearchSortFactory.java

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66

77

88
import org.hibernate.search.engine.search.common.NonStaticMetamodelScope;
9-
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
10-
import org.hibernate.search.engine.search.reference.sort.DistanceSortFieldReference;
11-
import org.hibernate.search.engine.search.reference.sort.FieldSortFieldReference;
12-
import org.hibernate.search.engine.spatial.GeoPoint;
13-
import org.hibernate.search.util.common.SearchException;
149
import org.hibernate.search.util.common.annotation.Incubating;
1510

1611
/**
@@ -44,98 +39,6 @@
4439
*/
4540
public interface SearchSortFactory extends TypedSearchSortFactory<NonStaticMetamodelScope> {
4641

47-
/**
48-
* Order elements by the value of a specific field.
49-
* <p>
50-
* The default order is <strong>ascending</strong>.
51-
*
52-
* @param fieldPath The <a href="#field-paths">path</a> to the index field to sort by.
53-
* @return A DSL step where the "field" sort can be defined in more details.
54-
* @throws SearchException If the field doesn't exist or cannot be sorted on.
55-
*/
56-
FieldSortOptionsStep<NonStaticMetamodelScope, ?, ? extends SearchPredicateFactory> field(String fieldPath);
57-
58-
/**
59-
* Order elements by the value of a specific field.
60-
* <p>
61-
* The default order is <strong>ascending</strong>.
62-
*
63-
* @param fieldReference The reference representing the <a href="#field-paths">path</a> to the index field to sort by.
64-
* @return A DSL step where the "field" sort can be defined in more details.
65-
* @throws SearchException If the field doesn't exist or cannot be sorted on.
66-
*/
67-
@Incubating
68-
<T> FieldSortOptionsGenericStep<NonStaticMetamodelScope, T, ?, ?, ? extends SearchPredicateFactory> field(
69-
FieldSortFieldReference<? super NonStaticMetamodelScope, T> fieldReference);
70-
71-
/**
72-
* Order elements by the distance from the location stored in the specified field to the location specified.
73-
* <p>
74-
* The default order is <strong>ascending</strong>.
75-
*
76-
* @param fieldPath The <a href="#field-paths">path</a> to the index field
77-
* containing the location to compute the distance from.
78-
* @param location The location to which we want to compute the distance.
79-
* @return A DSL step where the "distance" sort can be defined in more details.
80-
* @throws SearchException If the field type does not constitute a valid location.
81-
*/
82-
DistanceSortOptionsStep<NonStaticMetamodelScope, ?, ? extends SearchPredicateFactory> distance(String fieldPath,
83-
GeoPoint location);
84-
85-
/**
86-
* Order elements by the distance from the location stored in the specified field to the location specified.
87-
* <p>
88-
* The default order is <strong>ascending</strong>.
89-
*
90-
* @param fieldReference The reference representing the <a href="#field-paths">path</a> to the index field
91-
* containing the location to compute the distance from.
92-
* @param location The location to which we want to compute the distance.
93-
* @return A DSL step where the "distance" sort can be defined in more details.
94-
* @throws SearchException If the field type does not constitute a valid location.
95-
*/
96-
@Incubating
97-
default DistanceSortOptionsStep<NonStaticMetamodelScope, ?, ? extends SearchPredicateFactory> distance(
98-
DistanceSortFieldReference<? super NonStaticMetamodelScope> fieldReference, GeoPoint location) {
99-
return distance( fieldReference.absolutePath(), location );
100-
}
101-
102-
/**
103-
* Order elements by the distance from the location stored in the specified field to the location specified.
104-
* <p>
105-
* The default order is <strong>ascending</strong>.
106-
*
107-
* @param fieldPath The <a href="#field-paths">path</a> to the index field
108-
* containing the location to compute the distance from.
109-
* @param latitude The latitude of the location to which we want to compute the distance.
110-
* @param longitude The longitude of the location to which we want to compute the distance.
111-
* @return A DSL step where the "distance" sort can be defined in more details.
112-
* @throws SearchException If the field type does not constitute a valid location.
113-
*/
114-
default DistanceSortOptionsStep<NonStaticMetamodelScope, ?, ? extends SearchPredicateFactory> distance(String fieldPath,
115-
double latitude,
116-
double longitude) {
117-
return distance( fieldPath, GeoPoint.of( latitude, longitude ) );
118-
}
119-
120-
/**
121-
* Order elements by the distance from the location stored in the specified field to the location specified.
122-
* <p>
123-
* The default order is <strong>ascending</strong>.
124-
*
125-
* @param fieldReference The reference representing the <a href="#field-paths">path</a> to the index field
126-
* containing the location to compute the distance from.
127-
* @param latitude The latitude of the location to which we want to compute the distance.
128-
* @param longitude The longitude of the location to which we want to compute the distance.
129-
* @return A DSL step where the "distance" sort can be defined in more details.
130-
* @throws SearchException If the field type does not constitute a valid location.
131-
*/
132-
@Incubating
133-
default DistanceSortOptionsStep<NonStaticMetamodelScope, ?, ? extends SearchPredicateFactory> distance(
134-
DistanceSortFieldReference<? super NonStaticMetamodelScope> fieldReference, double latitude,
135-
double longitude) {
136-
return distance( fieldReference, GeoPoint.of( latitude, longitude ) );
137-
}
138-
13942
/**
14043
* Create a new sort factory whose root for all paths passed to the DSL
14144
* will be the given object field.

engine/src/main/java/org/hibernate/search/engine/search/sort/dsl/spi/SearchSortFactoryDelegate.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import org.hibernate.search.engine.search.common.NamedValues;
1111
import org.hibernate.search.engine.search.common.NonStaticMetamodelScope;
12-
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
12+
import org.hibernate.search.engine.search.predicate.dsl.TypedSearchPredicateFactory;
1313
import org.hibernate.search.engine.search.reference.sort.FieldSortFieldReference;
1414
import org.hibernate.search.engine.search.sort.dsl.CompositeSortComponentsStep;
1515
import org.hibernate.search.engine.search.sort.dsl.DistanceSortOptionsStep;
@@ -38,23 +38,27 @@ public SortThenStep<NonStaticMetamodelScope> indexOrder() {
3838
}
3939

4040
@Override
41-
public FieldSortOptionsStep<NonStaticMetamodelScope, ?, ? extends SearchPredicateFactory> field(String fieldPath) {
42-
// TODO
43-
return null;
41+
public FieldSortOptionsStep<NonStaticMetamodelScope,
42+
?,
43+
? extends TypedSearchPredicateFactory<NonStaticMetamodelScope>> field(String fieldPath) {
44+
return delegate.field( fieldPath );
4445
}
4546

4647
@Override
47-
public <T> FieldSortOptionsGenericStep<NonStaticMetamodelScope, T, ?, ?, ? extends SearchPredicateFactory> field(
48-
FieldSortFieldReference<? super NonStaticMetamodelScope, T> fieldReference) {
49-
// TODO
50-
return null;
48+
public <T> FieldSortOptionsGenericStep<NonStaticMetamodelScope,
49+
T,
50+
?,
51+
?,
52+
? extends TypedSearchPredicateFactory<NonStaticMetamodelScope>> field(
53+
FieldSortFieldReference<? super NonStaticMetamodelScope, T> fieldReference) {
54+
return delegate.field( fieldReference );
5155
}
5256

5357
@Override
54-
public DistanceSortOptionsStep<NonStaticMetamodelScope, ?, ? extends SearchPredicateFactory> distance(String fieldPath,
55-
GeoPoint location) {
56-
// TODO
57-
return null;
58+
public DistanceSortOptionsStep<NonStaticMetamodelScope,
59+
?,
60+
? extends TypedSearchPredicateFactory<NonStaticMetamodelScope>> distance(String fieldPath, GeoPoint location) {
61+
return delegate.distance( fieldPath, location );
5862
}
5963

6064
@Override

0 commit comments

Comments
 (0)