Let me give the full user case... There has been a little
misunderstanding, but really some good discussions...

1. Some Cardiologists are also Family Doctors and Internal Medicine
doctors (Internist).
2. The use case that confuses the users is the output of the query
when using dismax across 2 fields (search name and specialties, but
when it matches exactly on specialties, someone know that...).

q=Cardiologist&defType=dismax&qf=specialties^1.0
name^2.0&facet=true&facet.field=specialties

numFound=812 but the facet for Cardiologist is 700. The discrepency is
that some are matching soundex...

So they see as specialties:
Cardiologist: 700
Internist: 45
Family Doctor: 20

But since the string "Cardiologist" matches what they type, I would
like it selected and limit to 700.

But if it does not match I want it ignored.

In essence I want: fq=specialties:"what user types" but only if it
matches. It it does not match I want it ignored... Something like:

fq=IF(count(specialties:Cardiologist)>0)specialties:Cardiologist,*:*

Or more generic:

fq=IF(count(specialties:$input)>0)specialties:$input,*:*

Not sure how to do that without 2 queries into Solr.

Thank you.


On Wed, Jun 22, 2011 at 6:27 AM, lee carroll
<lee.a.carr...@googlemail.com> wrote:
> Hi Bill,
>
>>So that part works. Then when I output the facet, I need a different
>>behavior than the default. I need
>>The facet to only output the value that matches (scored) - NOT ALL VALUES
>>in the multiValued field.
>
>>I think it makes sense?
>
> Why do you need this ? If your use case is faceted navigation then not showing
> all the facet terms which match your query would be mis-leading to your users.
> The fact is your data indicates Ben the cardiologist is also a GP etc.
> Is it not valid for
> your users to be able to further filter on cardiologists who are also
> specialists in x other disciplines ? If the specialisms are mutually
> exclusive then your data will reflect this.
>
> The fact is x number of cardiologists match and x number of GP's match etc
>
> I may be missing the point here as you have not said why you need to do this ?
>
> cheers lee c
>
>
> On 22 June 2011 09:34, Michael Kuhlmann <s...@kuli.org> wrote:
>> Am 22.06.2011 09:49, schrieb Bill Bell:
>>> You can type q=cardiology and match on cardiologist. If stemming did not
>>> work you can just add a synonym:
>>>
>>> cardiology,cardiologist
>>
>> Okay, synonyms are the only way I can think of a realistic match.
>>
>> Stemming won't work on a facet field; you wouldn't get "Cardiologist: 3"
>> as the result but "cardiolog: 3" or something like that instead.
>>
>> Normally, you use declare facet field explicitly for facetting, and not
>> for searching, exactly because stemming and tokenizing on facet fields
>> don't make sense.
>>
>> And the short answer is: No, that's not possible.
>>
>> -Kuli
>>
>



-- 
Bill Bell
billnb...@gmail.com
cell 720-256-8076

Reply via email to