Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differing Apache Solr results when doing queries through Drupal – why?

Tags:

solr

drupal

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?

like image 578
mikl Avatar asked Mar 09 '09 16:03

mikl


1 Answers

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

like image 145
Mauricio Scheffer Avatar answered Oct 06 '22 18:10

Mauricio Scheffer