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

Never use search#hitCount() without check if it is exact

XMLWordPrintable

      Hibernate Search raise the exception:

      org.hibernate.search.util.common.SearchException: HSEARCH000587: Unable to provide the exact total hit count: only a lower-bound approximation is available. This is generally the result of setting query options such as a timeout or the total hit count threshold. Either unset these options, or retrieve the lower-bound hit count approximation through '.total().hitCountLowerBound()'
      

      if the returned SearchResultTotal is not exact.

      Before we call this method, we always need to check it.

      In the current code, it seems that CQCreateEagerQuery does not do that.

      Moreover, we need to add a test case for a broadcast query where the hit count accuracy is less than the indexed entities potentially to be counted.

      This is a regression, due by the ISPN-14195.

      Possible workarounds:

      1. Raise the hit count accuracy to the query instance
      2. Raise the hit count accuracy default for all queries using the query configuration

              fercoli@redhat.com Fabio Massimo Ercoli
              fercoli@redhat.com Fabio Massimo Ercoli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: