godong9 / solr-node

Simple Solr Node Client Project.
MIT License
25 stars 25 forks source link

Doc Incorrect on How To Use addParams #87

Open ddigioia3 opened 5 years ago

ddigioia3 commented 5 years ago

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.