SolrSearch default RequestHandler

40 views
Skip to first unread message

Tyler Mobley

unread,
Feb 13, 2015, 11:07:52 AM2/13/15
to omek...@googlegroups.com
I'm tweaking stuff in the SolrSearch plugin, and I have a quick question before I dig too deep in the wrong direction. 

Looking at the ResultsController, I see that some params are getting passed at query time to Solr, which makes sense given the need for local plugin settings. I've added some of my own for facet paging and result sorting there already. However, I don't see the 'qt' being set there, and I don't see a RequestHandler marked as default in solrconfig.xml. Am I correct in assuming then that SolrSearch is just passing extra params to the basic 'select' RequestHandler? If so, I'll add qt to the params sent via the controller and make a new requesthandler of my own, but I don't want to waste time missing something obvious.

Thanks!

Tyler

Tyler Mobley

unread,
Feb 13, 2015, 2:01:32 PM2/13/15
to omek...@googlegroups.com
Answered my own question. Answer is, yes, SolrSearch is using default 'select' behavior and just passing additional settings (highlighting, etc.) along with the query. Moving on!

Amanda Shuman

unread,
Mar 28, 2017, 12:13:32 PM3/28/17
to Omeka Dev
Hi - do you mind sharing how exactly you accomplished this? Do I need to add another Request Handler or just modify the /select one already in the solrconfig.xml? Do I modify the ResultsController.php in this area:

  /**
     * Intercept queries from the simple search form.
     */
    public function interceptorAction()
    {
        $this->_redirect('solr-search?'.http_build_query(array(
            'q' => $this->_request->getParam('query')
        )));
    }

I am not really sure, rather new to solr search here... basically what I want to do is add a qf query that boosts / weighs certain fields more than others. Thanks for any advice!

Best,
Amanda

Tyler Mobley

unread,
Mar 28, 2017, 3:33:09 PM3/28/17
to Omeka Dev
Hi Amanda,

Sure thing. Mine is a weird use case, but in short if you just want to add parameters to send on to Solr along with your query, add them in ResultsController.php in the array around line 157. However, if you want these boosts to be standard behavior and don't plan on changing them per search, I would just add them as a qf list directly in your solrconfig.xml file in your Solr installation. My use cases always end up with a known field set, so the following might show up in a requestHandler of mine:

<str name="qf"> title_teim^100000 subject_teim^500 creator_teim^5000 coverage_teim^250 description_teim^500 publisher_teim^200 format_teim^200 type_teim^150 identifier_teim rights_teim relation_teim^250 date_teim^300 extent_teim medium_teim spatial_teim id </str>

Thanks,
Tyler
Reply all
Reply to author
Forward
0 new messages