Differing Apache Solr results when doing queries t

2019-03-20 23:50发布

I'm trying to create a custom search interface for Apache Solr using Drupal, and I'm having some strange issues with the results.

I have the same query yielding 8 hits when I run it from Solr's built-in web interface, and 0 hits when I run it through Drupal. Can anyone explain why?

Here's the queries, both taken from the Solr log:

  • Solr backend

    INFO: [] webapp=/solr path=/select params={wt=standard&rows=10&start=0&explainOther=&hl.fl=&indent=on&q=ss_cck_field_goal:sell+AND+ss_cck_field_type:(own+OR+coop+OR+house+OR+commercial)+AND+is_price:[10000+TO+5560000]&fl=*,score&qt=standard&version=2.2} hits=8 status=0 QTime=2

  • Drupal ApacheSolr module

    09-Mar-2009 15:37:31 org.apache.solr.core.SolrCore execute INFO: [] webapp=/solr path=/select params={wt=json&rows=10&json.nl=map&start=0&q=ss_cck_field_goal:sell+AND+ss_cck_field_type:(own+OR+coop+OR+house+OR+commercial)+AND+is_price:[10000+TO+5560000]&version=1.2} hits=0 status=0 QTime=9

The only thing that sticks out in my eyes is the version=1.2 parameter, but I've tried removing it, and that doesn't change the behavior.

After lots of tweaking, I've managed to the Drupal module to send more or less the same parameters, but it still gives 0 results:

09-Mar-2009 17:47:43 org.apache.solr.core.SolrCore execute INFO: [] webapp=/solr path=/select params={wt=standard&rows=10&start=0&q=ss_cck_field_goal:sell+AND+ss_cck_field_type:(own+OR+coop+OR+house+OR+commercial)+AND+is_price:[10000+TO+5560000]} hits=0 status=0 QTime=13

Can anyone explain this?

标签: drupal solr
2条回答
叼着烟拽天下
2楼-- · 2019-03-21 00:34

The request handler (qt parameter) might be different. When not defined (the Drupal query doesn't define it) Solr uses the default handler. Maybe the default handler configured is not the standard request handler... check your solrconfig.xml

查看更多
叛逆
3楼-- · 2019-03-21 00:40

could it be that there should be a non-empty fl (field list) parameter in the Drupal query? no fields to display: no results?

查看更多
登录 后发表回答