Two things:

1> There's really no need to define two request handlers here. The
<defaults> section is exactly that, defaults which can be overridden
by the URL. So rather than have select_group_b, use something like

... solr/collection/select_group_a?q=whatever&qf=F2,F3,F5

2> When you add a field qualifier to an edismax query, it overrides
all the qf definitions. Consider using an fq (filter query) clause by
adding  &fq=type:(PDF OR DOC OR TXT)


Best,
Erick

On Wed, May 13, 2015 at 6:15 PM, Steven White <swhite4...@gmail.com> wrote:
> Looks like I got it working (however I still have an outstanding issue, see
> end of my email).
>
> Here is what I have done:
>
> 1) In my solrconfig.xml, I created:
>
>   <requestHandler name="/select_group_a" class="solr.SearchHandler">
>      <lst name="defaults">
>        <str name="echoParams">explicit</str>
>        <int name="rows">20</int>
>        <str name="defType">edismax</str>
>        <str name="qf">F1 F2 F3</str>
>        <str name="fl">type,id,score</str>
>        <str name="wt">xml</str>
>        <str name="indent">true</str>
>      </lst>
>   </requestHandler>
>
> And
>
>   <requestHandler name="/select_group_b" class="solr.SearchHandler">
>      <lst name="defaults">
>        <str name="echoParams">explicit</str>
>        <int name="rows">20</int>
>        <str name="defType">edismax</str>
>        <str name="qf">F2 F3 F5</str>
>        <str name="fl">type,id,score</str>
>        <str name="wt">xml</str>
>        <str name="indent">true</str>
>      </lst>
>   </requestHandler>
>
> 2) My search URL is now:
> http://localhost:8983/solr/db/select_group_a?q.op=OR&q=<search string>  and
>  http://localhost:8983/solr/db/select_group_b?q.op=OR&q=<search string>
>
> This all works, BUT when I use "q=type:(PDF OR DOC OR TXT)" so that I can
> further narrow down search to within, for example, file-extensions, this
> doesn't seem to work.  Is this because using "qf" with edismax ends doesn't
> parse the string the same way as the default defType?
>
> Steve
>
> On Wed, May 13, 2015 at 6:11 PM, Steven White <swhite4...@gmail.com> wrote:
>
>> Thanks for the quick reply Shawn.  I will dig into dismax and edismax and
>> come back with questions if I cannot figure it out.  I avoided them
>> thinking they are for faceting use only, my need is generic search (all the
>> features I get via solr.SearchHandler) but limited to a set of fields.
>>
>> Steve
>>
>> On Wed, May 13, 2015 at 5:58 PM, Shawn Heisey <apa...@elyograg.org> wrote:
>>
>>> On 5/13/2015 3:36 PM, Steven White wrote:
>>> >   <requestHandler name="/select_group_a" class="solr.SearchHandler">
>>> >      <lst name="defaults">
>>> >        <str name="echoParams">explicit</str>
>>> >        <int name="rows">20</int>
>>> >        <str name="df">F2,F3,F5</str>
>>> >    <str name="fl">id,score</str>
>>> >      </lst>
>>> >   </requestHandler>
>>> >
>>> > However, this isn't working because whatever is in "df" is being
>>> treated as
>>> > single field name.
>>>
>>> The df parameter is shorthand for "default field."  It is, by
>>> definition, a single field -- it is the field searched by default when
>>> you don't specify a field directly in a query handled by the default
>>> (lucene) query parser.  The default parser doesn't search multiple
>>> fields for your search terms.
>>>
>>> What you're going to want to do here is use a different query parser --
>>> dismax or edismax -- and put your field list in the qf field, separated
>>> by spaces rather than commas.  The qf parameter means "query fields" and
>>> is specific to the dismax/edismax parsers.  Depending on your exact
>>> needs, you may also want to define the pf parameter as well (phrase
>>> fields).
>>>
>>> There is a LOT of detail on these parsers, so I'll give you the
>>> documentation links rather than try and explain everything:
>>>
>>> https://cwiki.apache.org/confluence/display/solr/The+DisMax+Query+Parser
>>>
>>> https://cwiki.apache.org/confluence/display/solr/The+Extended+DisMax+Query+Parser
>>>
>>> Thanks,
>>> Shawn
>>>
>>>
>>

Reply via email to