Arrays of events need to be posted to POST http://localhost:7070/batch/events.json?accessKey=… Notice the different URL. Look towards the bottom of this page: https://predictionio.incubator.apache.org/datacollection/eventmodel/ <https://predictionio.incubator.apache.org/datacollection/eventmodel/>
On Jun 16, 2017, at 7:35 AM, Shane Johnson <[email protected]> wrote: Has anyone extended PredictionIO to handle an array of objects instead of Posting a single object to get individual scores. For example if I post this to localhost:8000/queries.json { "AccountId": "0016A000001vxxxxx", "OpportunityId": "0066A000001xxxxxx", "NaicsCode": 518420, "AnnualRevenue": 100000000, "NumberOfEmployees": 10000, "BillingState": "Virginia", "BillingCountry": "United States" } I get the expected response of { "score": 0.7110000252723694 } but when I post this [ { "AccountId": "0016A000001vxxxxx", "OpportunityId": "0066A000001xxxxxx", "NaicsCode": 518420, "AnnualRevenue": 100000000, "NumberOfEmployees": 10000, "BillingState": "Virginia", "BillingCountry": "United States" }, { "AccountId": "0045H000001xxxxxx", "OpportunityId": "0088A000001exxxxx", "NaicsCode": 518420, "AnnualRevenue": 100000000, "NumberOfEmployees": 10000, "BillingState": "Virginia", "BillingCountry": "United States" } ] I get the following error. Query: [ ... ] Stack Trace: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176) I expected to get the error but am hoping someone could point me in the right direction on where to extend the Scala code to interpret an Array of Objects into the Query object and then return multiple scores. Thanks in advance if anyone has worked on this. Shane Johnson | 801.360.3350 LinkedIn <https://www.linkedin.com/in/shanewjohnson> | Facebook <https://www.facebook.com/shane.johnson.71653>
