-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HSEARCH-4577 @ProjectionConstructor: aggregating multi-valued field/object projections in Set, SortedSet, etc. instead of List #4329
Closed
marko-bekhta
wants to merge
7
commits into
hibernate:main
from
marko-bekhta:feat/HSEARCH-4577-ProjectionConstructor-aggregating-multi-valued-fieldobject-projections-in-Set-SortedSet
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6a88c3b
HSEARCH-4577 Add a basic mechanism to request non-list multi-valued p…
marko-bekhta 8124c5f
HSEARCH-4577 Allow non-list collections within projection constructors
marko-bekhta 138fedc
HSEARCH-4577 Update some deprecations and cleanups
marko-bekhta c94bcb1
HSEARCH-4577 Enable other collections for highlight projections
marko-bekhta c223e0a
HSEARCH-4577 Enable other collections for distance projections
marko-bekhta 341b610
HSEARCH-4577 Enable other collections for object projections
marko-bekhta 7e7e889
HSEARCH-4577 More cleanups and addressing remaining TODOs
marko-bekhta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...nate/search/documentation/search/projection/MyBookTitleAndAuthorNamesInSetProjection.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,24 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* Copyright Red Hat Inc. and Hibernate Authors | ||
*/ | ||
package org.hibernate.search.documentation.search.projection; | ||
|
||
import java.util.Set; | ||
|
||
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FieldProjection; | ||
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ProjectionConstructor; | ||
|
||
// @formatter:off | ||
//tag::include[] | ||
@ProjectionConstructor // <1> | ||
public record MyBookTitleAndAuthorNamesInSetProjection( | ||
@FieldProjection // <2> | ||
String title, // <3> | ||
@FieldProjection(path = "authors.lastName") // <4> | ||
Set<String> authorLastNames // <5> | ||
) { | ||
} | ||
//end::include[] | ||
// @formatter:on | ||
|
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
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
12 changes: 12 additions & 0 deletions
12
.../org/hibernate/search/engine/search/projection/dsl/MultiHighlightProjectionFinalStep.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,12 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* Copyright Red Hat Inc. and Hibernate Authors | ||
*/ | ||
package org.hibernate.search.engine.search.projection.dsl; | ||
|
||
/** | ||
* The final step in a multi-valued highlight definition, where the collection {@code C} can be different from the default {@link java.util.List}. | ||
*/ | ||
public interface MultiHighlightProjectionFinalStep<C> extends ProjectionFinalStep<C> { | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether renaming this from multi to container and then adding built-in type references for optional is a good idea ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for
container
as the default is already "multi", so it feels a bit weird to introduce a "multi".However, don't we expose "multi" methods in other DSLs, especially in the search DSL? We'd need to be consistent...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we also have that
HighlightProjectionOptionsStep#single()
...It would be nice if we can just deprecate all that and do something like
(well and the same thing in other places: deprecate the multi and give this accumulator as an alternative)