jira-importer commented on issue #444:
URL: https://github.com/apache/maven-indexer/issues/444#issuecomment-2965141056

   **[Tamas 
Cservenak](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=cstamas)**
 commented
   
   This issue is fixed. MINDEXER-22 is a followup from part of this issue and 
earlier messy implementation.
   
   All search types now have the `#setCount( maxDocs )` method, that allows the 
user to _limit_ (cap) the number of Lucene Documents to process while executing 
search.
   
   To check "is there more" (if you capped the search): 
`response.getTotalHitCount() > maxDocs`
   
   This above would be somewhat equal to the "hit limit" with 4.0.0, with big 
difference, that here, results are still returned (but capped, just the "top 
maxDocs" one).
   
   Example: If integrating into server and exposing search over rest (a la 
Nexus use case), you probably want to cap it aggressively to avoid OOMExes and 
other possible exploits/attacks.
   
   Also, the "workaround loop" described by Jesse is implemented and happens 
_undercover_ when a non-capped search happens. Initial search happens with a 
"window" of 1000 hits, and if it does not fit (totalHits > 1000), it repeats 
the same search, but this time uses the exact totalHit number from previous 
search. Since this could easily lead to OOMEx, in DEBUG logging level a "note" 
(and pointer to this issue) is logged just before the point where OOMEx is 
expected.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to