[infinispan-issues] [JBoss JIRA] (ISPN-11013) Selecting a single field in a query returns wrong "total_count"

Jens Reimann (Jira) issues at jboss.org
Tue Dec 3 08:17:00 EST 2019


    [ https://issues.jboss.org/browse/ISPN-11013?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13820281#comment-13820281 ] 

Jens Reimann commented on ISPN-11013:
-------------------------------------

Yes. And I can also see the change in behavior when selecting a non-indexed-stored field vs an index-stored one:

{code}
oc -n enmasse-infra rsh infinispan-0 curl "http://app:test12@infinispan-0:11222/rest/v2/caches/devices?action=search&query=select+d.tenantId+from+io.enmasse.iot.infinispan.device.DeviceInformation+d&max_results=1"
{
  "total_results" : 10000,
  "hits" : [ {
    "hit" : {
      "tenantId" : "jbtest.iot/2019-12-03T12:58:54Z"
    }
  } ]
}
{code}

vs:

{code}
oc -n enmasse-infra rsh infinispan-0 curl "http://app:test12@infinispan-0:11222/rest/v2/caches/devices?action=search&query=select+d.deviceId+from+io.enmasse.iot.infinispan.device.DeviceInformation+d&max_results=1"
{
  "total_results" : 1,
  "hits" : [ {
    "hit" : {
      "deviceId" : "http-inserter-kgxhm0"
    }
  } ]
}
{code}

I re-checked the documentation about that, but couldn't find any hint about that. I guess it would be helpful to document that behavior.

> Selecting a single field in a query returns wrong "total_count"
> ---------------------------------------------------------------
>
>                 Key: ISPN-11013
>                 URL: https://issues.jboss.org/browse/ISPN-11013
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Remote Querying
>    Affects Versions: 10.0.1.Final
>            Reporter: Jens Reimann
>            Assignee: Gustavo Fernandes
>            Priority: Major
>         Attachments: deviceManagement.proto, infinispan.xml
>
>
> Adding a field selector to the query returns the wrong "total_count" in the result:
> {code:java}
> ➜  openshift oc -n enmasse-infra rsh infinispan-0 curl 'http://app:test12@infinispan-0:11222/rest/v2/caches/devices?action=search&query=from+io.enmasse.iot.registry.infinispan.data.DeviceInformation+d&max_results=1' 
> {
>   "total_results" : 38847,
>   "hits" : [ {
>     "hit" : {
>       "_type" : "io.enmasse.iot.registry.infinispan.data.DeviceInformation",
>       "tenantId" : "jbtest.iot/2019-11-29T08:52:39Z",
>       "deviceId" : "http-inserter-wh5xn103",
>       "version" : "992899e8-c557-4a2c-8bc0-db950a803898",
>       "registrationInformation" : "{}",
>       "credentials" : [ {
>         "authId" : "device-103",
>         "type" : "hashed-password",
>         "secrets" : [ "{\"hash-function\":\"bcrypt\",\"pwd-hash\":\"$2y$12$JELemetlJuc.6ZgQkCn5X..7UEPQm5iQV23lgno7/2sEKY2i.mPmS\"}" ]
>       } ]
>     }
>   } ]
> }
> {code}
> {code:java}
> ➜  openshift oc -n enmasse-infra rsh infinispan-0 curl 'http://app:test12@infinispan-0:11222/rest/v2/caches/devices?action=search&query=select+d.deviceId+from+io.enmasse.iot.registry.infinispan.data.DeviceInformation+d&max_results=1'
> {
>   "total_results" : 1,
>   "hits" : [ {
>     "hit" : {
>       "deviceId" : "http-inserter-wh5xn103"
>     }
>   } ]
> }
> {code}



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the infinispan-issues mailing list