0

I have installed apachesolr module and built the index for it. now i can search normally but when i filter the result using any enabled filter, the result DOES'T change and i get the same result of searching for the key. for example i searched for business and then filtered the result using taxonomy tid:36 and i got the same result before filtering!!
I have var_dump the $query that has been generated at line 215 in apachesolr_search.module and part of the result is shown below

object(Solr_Base_Query)#17 (13) {
  ["id"]=>
  int(1)
  ["fields":protected]=>
  array(0) {
  }
  ["fields_added":protected]=>
  array(0) {
  }
  ["fields_removed":protected]=>
  array(0) {
  }
  ["filterstring":protected]=>
  string(6) "tid:36"
  ["field_map":protected]=>
  array(0) {
  }
  ["subqueries":protected]=>
  array(0) {
  }
  ["keys":protected]=>
  string(8) "business"
  ["base_path":protected]=>
  string(24) "search/apachesolr_search"
  ["solr":protected]=>
  object(Drupal_Apache_Solr_Service)#16 (20) {....

also the filter doesn't appear in CURRENT SEARCH block. the block still showing

CURRENT SEARCH
Search found 38 items

  • (-) business

Also I have made a var_dump for params array that has been generated in function apachesolr_search_execute in apachesolr_search.module at line 212 and the result was:

array(13) {
  ["fl"]=>
  string(71) "id,nid,title,comment_count,type,created,changed,score,path,url,uid,name"
  ["rows"]=>
  int(10)
  ["facet"]=>
  string(4) "true"
  ["facet.mincount"]=>
  int(1)
  ["facet.sort"]=>
  string(4) "true"
  ["hl"]=>
  NULL
  ["hl.fragsize"]=>
  NULL
  ["hl.simple.pre"]=>
  NULL
  ["hl.simple.post"]=>
  NULL
  ["hl.snippets"]=>
  NULL
  ["hl.fl"]=>
  NULL
  ["spellcheck.q"]=>
  string(8) "business"
  ["spellcheck"]=>
  string(4) "true"
}

nothing for fq=tid:36
any idea of what i might be missing? or how to fix it?
Thanks for your help

  • Which version of the module are you using? – kekkis Apr 2 '12 at 14:40
  • latest version:6.x-1.6 – Alaa Apr 2 '12 at 18:30
  • The line 212 in apachesolr_search.module says function apachesolr_search_execute($keys, $filterstring, $solrsort, $base_path = '', $page = 0, $caller = 'apachesolr_search') { so there's nothing generated there. Faceting parameters are added only on line 232, so try var_dumping $params after that and then refine your question. You even get the $final_query only on line 235; that may be worth seeing as well. – kekkis Apr 3 '12 at 3:34
  • params already var_dumped in the question above. – Alaa Apr 3 '12 at 7:41
  • Yes they are, only you var_dumped them too early. They change after the stage you var_dump them at. Hence my previous comment. – kekkis Apr 3 '12 at 19:27
1

You should consider using Search API module, which can handle Solr and facets, and enables you to use Views to create the search page and has a very good UI for creating search index with facets ect.

I've used it several times and have been pleased with the result.

  • search_api is for drupal 7.x i have drupal 6.x. also i have tried this module before and it was working fine. but i dont know what is wrong this time :( – Alaa Apr 2 '12 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.