eclipse-rdf4j / rdf4j

Eclipse RDF4J: scalable RDF for Java
https://rdf4j.org/
BSD 3-Clause "New" or "Revised" License
367 stars 164 forks source link

GH-5149 Lucene numdocs param #5163

Closed ate47 closed 5 days ago

ate47 commented 4 weeks ago

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):

hmottestad commented 2 weeks ago

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.