Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

The last row positions in "IndexPagingState" may be deleted when querying the next page. #388

Open
johnyannj opened this issue May 4, 2018 · 0 comments

Comments

@johnyannj
Copy link

johnyannj commented May 4, 2018

SCLI's IndexPagingState contains the last row positions, which is used to query next page.
(com.stratio.cassandra.lucene.IndexPagingState)

But the row may be deleted when querying the next page.

In com.stratio.cassandra.lucene.index.DocumentIterator
we will get an Exception with "Last page position not found".

Is it possible to record scoreDocs directly into the IndexPagingState ?

DocumentIterator.scala:

 private[this] val afters = try {
    indices.map(i => afterTerms(i).map(term => {
      val time = TimeCounter.start
      val builder = new BooleanQuery.Builder
      builder.add(new TermQuery(term), FILTER)
      builder.add(query, MUST)
      val scores = searchers(i).search(builder.build, 1, sort).scoreDocs
      if (scores.nonEmpty) {
        tracer.trace("Lucene index seeks last index position")
        logger.debug(s"Start position found in $time")
        scores.head
      } else throw new IndexException("Last page position not found")
    })).toArray
  } catch {
    case e: Exception =>
      releaseSearchers()
      throw new IndexException(e, "Error while searching for the last page position")
  }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant