Ales Justin created ISPN-2448:
---------------------------------
Summary: Queries with offset are broken for iteration
Key: ISPN-2448
URL:
https://issues.jboss.org/browse/ISPN-2448
Project: Infinispan
Issue Type: Bug
Components: Querying
Affects Versions: 5.2.0.Beta2
Reporter: Ales Justin
Assignee: Sanne Grinovero
Fix For: 5.2.0.Beta3
The problem is with queries with offset when you iterate over them -- offset is never
taken into account.
There are two possible fixes -- as I see them.
1) In HS:
DocumentExtractorImpl::extract takes into account "firstIndex"
public EntityInfo extract(int scoreDocIndex) throws IOException {
int docId = queryHits.docId( firstIndex + scoreDocIndex );
Document document = extractDocument( fistIndex + scoreDocIndex );
2) LazyIterator in Infinispan-Query applies the offset:
protected EntityInfo loadEntityInfo(int index) {
try {
return extractor.extract(extractor.getFirstIndex() + index);
---
Since those methods are exposed in DocumentExtractor,
I would guess they were meant for external code to use them,
instead of putting this logic into extractor itself.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira