Skip to content

Conversation

gaborbernat
Copy link

@gaborbernat gaborbernat commented Oct 2, 2025

Fixes #4740

Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Oct 2, 2025
@QueryParam("projects") final List<String> projects,
@QueryParam("maxresults") // Akin to QueryParameters.COUNT_PARAM
@DefaultValue(MAX_RESULTS + "") final int maxResults,
@QueryParam(QueryParameters.SORT_PARAM) @DefaultValue("relevancy") final String sort,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use SortOrder.RELEVANCY.toString() instead of the hard-coded string literal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the Javadoc in IncomingFilter needs to be updated for the changed method signature.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot use SortOrder.RELEVANCY.toString() directly in the @DefaultValue annotation, because Java requires annotation values to be compile-time constants.

@vladak
Copy link
Member

vladak commented Oct 14, 2025

The Apirary documentation in the apiary.apib file needs update for the /search endpoint.

@vladak
Copy link
Member

vladak commented Oct 14, 2025

Also, needs a test case.

hits = collector.topDocs().scoreDocs;
} else {
// Field based sort; use TopFieldCollector
TopFieldCollector fieldCollector = TopFieldCollector.create(luceneSort, hitsPerPage * cachePages, Short.MAX_VALUE);
Copy link
Member

@vladak vladak Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this work w.r.t. the private TopScoreDocCollector collector; on line 135/143 ? In the luceneSort == null branch the private member is assigned however here local variable is used.

What about the results() function which uses this member ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, addressed it now 😊

@vladak
Copy link
Member

vladak commented Oct 14, 2025

Just a note: this conflicts with the changes done for Lucene 9.x update in PR #4867. It looks like this can be reconciled easily, though.

@gaborbernat
Copy link
Author

I signed the OCA on Friday any idea when it will be approved?

@gaborbernat gaborbernat force-pushed the 4740-feat branch 6 times, most recently from de4e5cc to b5fc9fa Compare October 15, 2025 01:24
@gaborbernat gaborbernat force-pushed the 4740-feat branch 4 times, most recently from 41ef174 to db9f5fa Compare October 16, 2025 02:39
@gaborbernat gaborbernat requested a review from vladak October 16, 2025 02:39
@gaborbernat gaborbernat force-pushed the 4740-feat branch 2 times, most recently from 66115c4 to 35d7af4 Compare October 16, 2025 02:41
Signed-off-by: Bernát Gábor <[email protected]>
Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Oct 16, 2025
@gaborbernat
Copy link
Author

@vladak when you can please take another look, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search API allow sort by path

2 participants