community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karthick Sankarachary (JIRA)" <>
Subject [jira] Created: (COMDEV-45) Max Out Hit Limits To Max Doc
Date Wed, 21 Apr 2010 00:28:49 GMT
Max Out Hit Limits To Max Doc

                 Key: COMDEV-45
             Project:  	 Community Development 
          Issue Type: Bug
            Reporter: Karthick Sankarachary

Currently, the IndexSearcher lets you limit the number of hits that a search returns. Ironically,
that option works against you if the limit is set to a very large number. In particular, during
the initialization of the search process, the hit queue attempts to allocate as many document
scores as the hit limit. Needless to say, this is bound to lead to out of memory issues in
the event the hit limit passed by the user is very large.

This issue can be verified by setting the hit limit to the maximum integer value (please see
test case attached herein.) Note that the test fails in the PriorityQueue#initialize method
as it tries to increase the hit limit by one (to make room for a sentinel object), which causes
an integer overflow (please see the stack trace attached herein.)

The root cause of this issue lies not in the priority queue, but in the index searcher itself.
Ideally, it should ensure that the hit limit does not exceed it's maxDoc count, which typically
is the maximum number of documents held in the underlying index reader. A patch that implements
the above sanity check has been attached herein.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message