Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2448

Queries with offset are broken for iteration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.2.0.Beta3
    • 5.2.0.Beta2
    • Embedded Querying
    • None

    Description

      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.

      Attachments

        Activity

          People

            rh-ee-galder Galder ZamarreƱo
            ajustin@redhat.com Ales Justin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: