solr-node icon indicating copy to clipboard operation
solr-node copied to clipboard

Doc Incorrect on How To Use addParams

Open ddigioia3 opened this issue 6 years ago • 0 comments

The doc shows using the addParams() method in the "Complex and Chained" as

client.query()
    .q({text:'test', title:'test'})
    .addParams({
        wt: 'json',
        indent: true
    })
    .start(1)
    .rows(1)
;

This suggests the params can be passed in as key value pairs, but this does not work.

It needs to be passed in as an array of objects as in the tests:

var params = [
        { field: 'sfield', value: 'loc' },
        { field: 'pt', value: '37.547184,126.972176' },
        { field: 'd', value: '10' }
      ]

Unsure which is intended, but only the latter works.

ddigioia3 avatar Aug 23 '19 03:08 ddigioia3