solrsolrclient

SOLR - Node: conflicts in 2 libraries


I was using solr-node library in node js.

solr-node: https://www.npmjs.com/package/solr-node

Function file of solr-node

https://github.com/godong9/solr-node/blob/master/lib/query.js

So while writing query, I was not able to find for edismax bq query so I checked in the module's query file, bq was not available.

So I checked in another module solr-client

solr-client: https://www.npmjs.com/package/solr-client

Function file of solr-client

https://github.com/lbdremy/solr-node-client/blob/master/lib/query.js

Here I found the edismax bq query and it works as expected So I moved to solr-client module and deleted the solr-node module

NOW >>>>>>>

I want to add spellcheck filter to query and the function is available in solr-node and not in solr-client

Is there any way to fix this?????

You can check both function file and search for bq and spellcheck


Solution

  • Most libraries allow you to add custom parameters that isn't supported by the library itself. Sometimes it's documented, sometimes you have to read through the source to find it.

    For your first example you can use:

    query.params.push('bq=field:foo')
    

    to add custom parameters (query refers to an instance of the Query object).