Issue Details (XML | Word | Printable)

Key: LUCENE-700
Type: Bug Bug
Status: Resolved Resolved
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Unassigned
Reporter: kaineci
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

endless loop when querying using BooleanQuery.

Created: 26/Oct/06 06:43 AM   Updated: 26/Oct/06 08:54 PM
Return to search
Component/s: Search
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Resolution Date: 26/Oct/06 08:54 PM


 Description  « Hide
the extreme case is: when querying term1, term2, term3 and current docid of inverted lists of term1, term2, term3 are 0, i (larger than 0), BucketTable.SIZE, what could happen in search???However this case should occur with low possibility.

BucketTable table = new BucketTable();
Random random = new Random();
int tmpValue = random.nextInt(Integer.MAX_VALUE);
table.newCollector().collect(0, 0);
table.newCollector().collect(tmpValue, tmpValue);
table.newCollector().collect(2048, 2048);
Bucket bucket = table.first;
while(bucket != null)

{ bucket = bucket.next; num++; }

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
kaineci added a comment - 26/Oct/06 06:49 AM
loop may be rewriten :while((bucket!=null) && (fisrst || (bucket != firstElem))) where firstElem stores the first elements of buckettable.

kaineci added a comment - 26/Oct/06 08:16 AM
i see.
.....
more = false;
end += BucketTable.SIZE;//corresponding one term
for (SubScorer sub = scorers; sub != null; sub = sub.next) {
Scorer scorer = sub.scorer;
while (!sub.done && scorer.doc() < end) {
....

the code above can limite the range of docid in fetching inverted list once.


Otis Gospodnetic added a comment - 26/Oct/06 04:49 PM
Is that while loop in your initial comment endless?
Can you write a little class/unit test that shows this?
I can't quite tell what's going on from your comments, but Paul or one of the other Scorer experts might.

Paul Elschot added a comment - 26/Oct/06 06:19 PM
It looks like the initially posted code is from BooleanScorer, but nowadays normally BooleanScorer2 is used.
Would it be possible to have a test case showing the problem?

Yonik Seeley added a comment - 26/Oct/06 08:54 PM
I don't see a problem with that code (and it's not used by default anyway).
If you have a testcase that can demonstrate a problem, please provide it and re-open.