Skip to content
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

GH-5149 Lucene numdocs param #5163

Merged

Conversation

ate47
Copy link
Contributor

@ate47 ate47 commented Oct 28, 2024

GitHub issue resolved: #5149

Briefly describe the changes proposed in this PR:

I added a virtual property to specify the maximum amount of results the user wants in a LuceneSail search.

For example, with the example in rdf4j.org it gives something like that:

PREFIX search: <http://www.openrdf.org/contrib/lucenesail#>

?subj search:matches [
	      search:query "search terms...";
	      search:numDocs 200 ] .

At the same time, I added the sail parameter maxQueryDocuments to set the maximum amount of documents the user can query. By default, it takes the value of maxDocuments to keep a backward compatibility.

LuceneSail lc = new LuceneSail();
lc.setParameter(LuceneSail.MAX_QUERY_DOCUMENTS_KEY, "200");

PR Author Checklist (see the contributor guidelines for more details):

  • my pull request is self-contained
  • I've added tests for the changes I made
  • I've applied code formatting (you can use mvn process-resources to format from the command line)
  • I've squashed my commits where necessary
  • every commit message starts with the issue number (GH-xxxx) followed by a meaningful description of the change

@hmottestad
Copy link
Contributor

This looks very good. Thanks for the tests!

I've added some comments. In particular I'm a bit unsure about the introduction of a second max config option.

@ate47 ate47 force-pushed the GH-5149-lucene-numdocs-param branch from ffa582e to 3e6454e Compare November 5, 2024 13:10
@ate47 ate47 requested a review from hmottestad November 5, 2024 14:47
…KEY and MAX_DOCUMENTS_KEY to DEFAULT_NUM_DOCS_KEY
@ate47 ate47 force-pushed the GH-5149-lucene-numdocs-param branch from 6fcd0f8 to 42a331d Compare November 14, 2024 14:12
@hmottestad hmottestad changed the base branch from develop to GH-5149-numdocs November 20, 2024 14:44
@hmottestad hmottestad merged commit 08b898c into eclipse-rdf4j:GH-5149-numdocs Nov 20, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants