Wednesday, 07 January 2009

Solr Custom Sort is a module that we made for the Air Miles Project. By default, Apache Solr doesn't allow you to add sort types. Basically, you can only use those that are standard set in advance. For the Air Miles project, this wasn't what we needed. Therefore, we're now working on the Custom Sort module, a module that allows us to add multiple sort criteria, with the ability to manage them all.

The challenge for us is now to get transparency. Today the module can only be managed by administers but in the future this should be possible for all users.
The solution was simple, we just had to overwrite the class that is implemented by Apache Solr.

  1. variable_set('apachesolr_query_class', array(
  2. 'solr_custom_sort',
  3. 'Solr_Custom_Query'
  4. ));

Written byStijn Vanden Brande

Obtained a Bachelor in ICT and headed straight for the Krimson office after that. This Drupal Developer goes beyond websites: operating systems, networking and programming in general. He knows everything. And when there's something he doesn't know, you can be certain that -by tomorrow- he will. On his way to obtaining a Master's degree. (we'll keep you posted) Always out to get someone with a practical joke. With him you're never safe on the Krimson work floor. He's really the search button of the Krew.

Thanks for sharing!

Anything new on the Custom Sort module?

Somewhat related, there's also a Facet Builder module for Apache Solr out now.

Thanks

This is useful, but where can I download the module? If it is still available?

Yes, it's still

Yes, it's still available.
You can download it here: http://drupal.org/node/682634.

Thanks a lot

Thanks a lot, but I'm getting the following error after install :

Fatal error: Class ApacheSolr_Custom_Query contains 3 abstract methods and must therefore be declared abstract or implement the remaining methods (Drupal_Solr_Query_Interface::get_keys, Drupal_Solr_Query_Interface::set_keys, Drupal_Solr_Query_Interface::remove_keys) in sites/all/modules/apachesolr_custom_sort/ApacheSolr_Custom_Query.php on line 452

Do you have any idea on what the problem could be?
Thanks again
Manuel

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <h4> <br>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo].
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.
QR-code Krimson Antwerpen

Antwerp

Zénobe Grammestraat 34
2018 Antwerp, Belgium
Call us: +32 (0)3 298 69 98
E-mail us: info@krimson.be
QR-code Krimson Gent

Ghent

Hof ter Dampoort
Dendermondsesteenweg 48A - 101
9000 Gent, Belgium
E-mail us: info@krimson.be

Contact us

By submitting this form, you accept the Mollom privacy policy.