Hi all, The both approaches Rukshan has mentioned, should work.
Thanks, On Wed, Nov 11, 2015 at 12:02 AM, Niranda Perera <[email protected]> wrote: > copying @gimantha > > On Wed, Nov 11, 2015 at 10:29 AM, Rukshan Premathunga <[email protected]> > wrote: > >> Hi Kalpa, >> >> try this, worked for me, >> >> you need to escape 'escape character' as well. >> { >> "tableName":"ORG_WSO2_CARBON_MSS_HTTPMONITORING", >> "query":"request_uri:\\/student\\/883343913V", >> "start":0, >> "count":100 >> } >> >> or try with exact searching, >> >> { >> "tableName":"ORG_WSO2_CARBON_MSS_HTTPMONITORING", >> "query":"request_uri:\"/student/883343913V\"", >> "start":0, >> "count":100 >> } >> >> Thanks and Regards. >> >> >> On Wed, Nov 11, 2015 at 9:55 AM, Kalpa Welivitigoda <[email protected]> >> wrote: >> >>> Hi DAS team, >>> >>> I am trying a search query via the REST API [1] in DAS 3.0.0 and [2] is >>> my payload of the POST request. When I try to invoke with [3] >>> (request-count.json has the payload) I get the following as the response, >>> >>> {"status":"failed","message":"Error in index search: Invalid query, a >>> term must have a field"} >>> >>> It works fine if I change the query element as in [4]. >>> >>> I found that "/" is a special character in lucene [5] and tried with >>> [6], still I get the same error response. >>> >>> Any idea of what is missing here? >>> >>> >>> [1] >>> https://docs.wso2.com/display/DAS300/Retrieving+All+Records+Matching+the+Given+Search+Query+via+REST+API >>> >>> [2] >>> { >>> "tableName":"ORG_WSO2_CARBON_MSS_HTTPMONITORING", >>> "query":"request_uri:/student/883343913V", >>> "start":0, >>> "count":100 >>> } >>> >>> [3] curl -k -H "Content-Type: application/json" -H "Authorization: Basic >>> YWRtaW46YWRtaW4=" [email protected] >>> https://localhost:9443/analytics/search >>> >>> [4] "query":"service_method:getStudent", >>> >>> [5] >>> https://lucene.apache.org/core/5_2_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#Escaping_Special_Characters >>> >>> [6] "query":"request_uri:\/student\/883343913V", >>> >>> -- >>> Best Regards, >>> >>> Kalpa Welivitigoda >>> Software Engineer, WSO2 Inc. http://wso2.com >>> Email: [email protected] >>> Mobile: +94776509215 >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> Rukshan Chathuranga. >> Software Engineer. >> WSO2, Inc. >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > *Niranda Perera* > Software Engineer, WSO2 Inc. > Mobile: +94-71-554-8430 > Twitter: @n1r44 <https://twitter.com/N1R44> > https://pythagoreanscript.wordpress.com/ > -- Gimantha Bandara Software Engineer WSO2. Inc : http://wso2.com Mobile : +94714961919
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
