Jump to content
JasperReports Library 7.0 is now available ×

Webservice data adapter modifies the query body when :> or := are used ?


christophe.spielmann

Recommended Posts

Hello,

I use the Webservice data adapter to query an elasticsearch nosql database. it seems that depending on the content of the initial query, I have sometimes a return from elastic and sometimes not.

https://community.jaspersoft.com/project/web-service-data-source for Jasper Report Server 6.3

After investigation I have found the reason. The query works in jasperstudio inside the Dataset And query dialog but inside the report it fails.

here is my body of my REST query (elasticsearch):

{
  "size": 0,
  "aggs": {
    "storages": {
      "filters": {
        "filters": {
          "LN2_storage": {
            "query_string": {
              "query":"sampletype:Urine AND nbr.aliquots:>=3",
              "analyze_wildcard": true,
              "default_field": "*"
            }
          },
          "ALL_storage": {
            "match_all": {}
          }
        }
      }
    }
  },
  "query": {
    "bool": {
      "must": [
        {
          "match_all": {}
        },
        {
          "query_string": {
            "query": "NOT _exists_:parents.1",
            "analyze_wildcard": true,
            "default_field": "*"
          }
        }
      ],
      "filter": [],
      "should": [],
      "must_not": []
    }
  }
}

The errors is located at  "query":"sampletype:Urine AND nbr.aliquots:>=3"

I think that the '>=' is interpreted somehow. I don't know why. May be it is considered as a parameter ?

I don't know How to overcome this issue.

Any clue welcome !

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...