Hi,
  I have a python scraper to query the solr index and get the top 'n'
results and process further. What I see is with the setting of the bq
parameter which has a lot of special chars, the output from the python call
differs from the results I get from the query issued in the web Solr
portal. I am trying to understand what could be causing the differences.
Without the bq parameter setting, the results are the same from the python
request calls to the web output.

The python code for the request are as follows where the params should be
url encoded and from what I understand no additional processing is needed.
Below is the snippet of code being issued:

import requests
payload = {'defType':'edismax', 'fl':'*,score','rows':'3',
'fq':'Status:Active', 'bq':'{!edismax bq='' mm=50% qf="ContactEmail^2
ContactName^2 URL^2 CompanyName^2"  v=$q}', 'qf':'searchfield', 'q':input}
r = requests.post(SolrIndexUrl, data=payload)
response = r.json()


The responseHeaders from the python call are:
"responseHeader":{
    "status":0,
    "QTime":0,
    "params":{
      "q":"sample input",
      "defType":"edismax",
      "qf":"searchfield",
      "fl":"*,score",
      "fq":"Status:Active",
      "rows":"3",
      "bq":"{!edismax bq= mm=50% qf=\"ContactEmail^2 ContactName^2 URL^2
CompanyName^2\"  v=$q}"}
  },

The response headers from the Json output on the Solr Web portal are:
"responseHeader":{ "status":0, "QTime":0, "params":{ "q":"sample input", "
defType":"edismax", "qf":"searchfield", "fl":"*,score", "fq":"Status:active",
"_":"1544661362690", "bq":"{!edismax bq='' mm=50% qf=\"ContactEmail^2
ContactName^2 URL^2 CompanyName^2\" v=$q}"}},

The response headers seem to match but not the results output. Could
someone let me know what could be issue?

Thanks,
Tanya

Reply via email to