We're using the Apache Solr Search module to allow users to filter search results; for example, if a user searches for Pepsi, they get all results, but along the left of our screen they get facets allowing them to filter by Post Date, Article Type, Trend, etc. (Ignore the HTML under Trends/Seasonal; we have the Themer module turned on.)

screenshot

We haven't done anything custom to this search that I know of, but there's something strange: all the facets EXCEPT post date sort descending by number of results. Filter by post date actually sorts by post date. We want that one to also filter by number of results. (It's not visible in the screenshot, but 2010, for example, has over 500 posts so we'd definitely like that one to be at the top.)

Is sorting a module setting somewhere? (There are blocks for each filter-by facet, but sort order is not one of the config settings.) I tried looking around in the code, and I found the spot in our search results page template where the entire left filter bar is printed out, but cannot for the life of me find (even with a full-site grep) where the variable it's printing is actually being set.

Don't know exact path for D6, but you can got to facet configuration, configure display - and there will be sort options with ability to enable/disable sorts and reorder sorting.

  • Nope, that was the first place I looked - as I said in the original question, there are blocks for each filter-by facet, and sort order is not one of the config settings. If you're saying there's another configuration page specifically for facets, I'll need more info, because I'm not aware of that. – EmmyS Sep 7 '11 at 13:47
  • I see. Just checked this at my d6 project, indeed, there's no such option for facets. due to difference in creating custom facets in D6 and D7 – 32i Sep 7 '11 at 15:01
  • Just checked, indeed, there's no such facet setting for Drupal 6. I'd say the way this can be changed -that's via custom sorting, hiddenly enabled for this facet via hook_apachesolr_modify_query() or via modifying facet - unfortunately, I didn't succeed with how to do it in Drupal 6(difference with Drupal 7 is that in seven facets goes via facetapi module that has such hook.) – 32i Sep 7 '11 at 15:05

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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