-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HSEARCH-3319 WIP: DRAFT: IDEA: TEST: Type-safe field references
- Loading branch information
1 parent
a7d4b3f
commit 4ba16cb
Showing
36 changed files
with
1,641 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
.../java/org/hibernate/search/engine/search/predicate/dsl/KnnPredicateVectorGenericStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Hibernate Search, full-text search for your domain model | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.search.engine.search.predicate.dsl; | ||
|
||
/** | ||
* The step in a "knn" predicate definition where the vector to match is defined. | ||
*/ | ||
public interface KnnPredicateVectorGenericStep<T> { | ||
/** | ||
* @param vector The vector from which to compute the distance to vectors in the indexed field. | ||
* @return The next step in the knn predicate DSL. | ||
*/ | ||
KnnPredicateOptionsStep matching(T vector); | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
.../org/hibernate/search/engine/search/predicate/dsl/MatchPredicateFieldMoreGenericStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Hibernate Search, full-text search for your domain model | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.search.engine.search.predicate.dsl; | ||
|
||
/** | ||
* The step in a "match" predicate definition where the value to match can be set | ||
* (see the superinterface {@link MatchPredicateMatchingStep}), | ||
* or optional parameters for the last targeted field(s) can be set, | ||
* or more target fields can be added. | ||
* | ||
* @param <S> The "self" type (the actual exposed type of this step). | ||
* @param <N> The type of the next step. | ||
* @param <T> The type of the match value. | ||
* @param <V> The type representing the fields. | ||
*/ | ||
public interface MatchPredicateFieldMoreGenericStep< | ||
S extends MatchPredicateFieldMoreGenericStep<?, N, T, V>, | ||
N extends MatchPredicateOptionsStep<?>, | ||
T, | ||
V> | ||
extends MatchPredicateMatchingGenericStep<N, T>, MultiFieldPredicateFieldBoostStep<S> { | ||
|
||
/** | ||
* Target the given field in the match predicate, | ||
* as an alternative to the already-targeted fields. | ||
* <p> | ||
* See {@link MatchPredicateFieldStep#field(String)} for more information about targeting fields. | ||
* | ||
* @param field The field with a <a href="SearchPredicateFactory.html#field-paths">path</a> to the index field | ||
* to apply the predicate on. | ||
* @return The next step. | ||
* | ||
* @see MatchPredicateFieldStep#field(String) | ||
*/ | ||
S field(V field); | ||
|
||
/** | ||
* Target the given fields in the match predicate, | ||
* as an alternative to the already-targeted fields. | ||
* <p> | ||
* See {@link MatchPredicateFieldStep#fields(String...)} for more information about targeting fields. | ||
* | ||
* @param fieldPaths The fields with <a href="SearchPredicateFactory.html#field-paths">paths</a> to the index fields | ||
* to apply the predicate on. | ||
* @return The next step. | ||
* | ||
* @see MatchPredicateFieldStep#fields(String...) | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
S fields(V... fieldPaths); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...a/org/hibernate/search/engine/search/predicate/dsl/MatchPredicateMatchingGenericStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Hibernate Search, full-text search for your domain model | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.search.engine.search.predicate.dsl; | ||
|
||
/** | ||
* The step in a "match" predicate definition where the value to match can be set. | ||
* | ||
* @param <N> The type of the next step. | ||
* @param <T> The type of the match value. | ||
*/ | ||
public interface MatchPredicateMatchingGenericStep<N extends MatchPredicateOptionsStep<?>, T> { | ||
|
||
/** | ||
* Require at least one of the targeted fields to match the given value. | ||
* | ||
* @param value The value to match. | ||
* The signature of this method defines this parameter as an {@code T}, | ||
* but a specific type is expected depending on the targeted field. | ||
* @return The next step. | ||
*/ | ||
N matching(T value); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.