tags:

views:

501

answers:

2

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?

A: 

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

ax
mikl
+3  A: 

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

Mauricio Scheffer
Ah yes, you are correct. The solrconfig.xml that comes with the Drupal module sets the default handler to dismax. Thanks :)
mikl