Solr help : customizing results page & avoid duplicate with browse

Hello,

I need some guidance concerning the SolrSearch plugin :

  • what is the best way to customize the Solr results page for my theme
  • how do I avoid doing the same work twice between items/browse and solr-search (yes, I need to keep both)

I’m thinking about modifying the plugin directly but it seems a bit brutal.
And I checked a bit if I could redirect the browse query and adapt it before doing solr query, but the items controller browseAction calls its parent which is the Abstract_Controller one. And I don’t know how to override it safely.

Thank you for your help.

You can theme the SolrSearch results page in the same fashion as Omeka. The plugin has a views/shared/ directory with the views used for public display. In your theme, create a solr-search/ subdirectory, and you can copy any of the files from the plugin’s directory there for modification.

Primarily, you should create solr-search/results/index.php in your theme starting with the code from views/shared/results/index.php in the SolrSearch directory.

You probably wont be able to use the same code for item browsing and Solr results. Solr returns results for more object types than just Items, produces snippets to highlight search terms in the results, and loads the sidebar with facets for the search. If you do find code that is reusable, you may want to consider putting it into a view.

Oooh plugin views, that’s cool. Thank you, that’s exactly it.

I kind of accepted the fact that I am in a weird situation.
For my layout, I need the facets but it will break every existing links elsewhere if I suddenly say “I won’t use items/browse”.

But there’s always a way, I’ll find it and put it here ^^
(I’ll be looking into making a new view but I feel it only shifts the problem)