RE: MultiValued facet behavior question

2012-11-26 Thread nicopost
Thanks Robert, your code helped me solve a problem I had! Saved me a lot of
time  headaches

cheers,  Nico



--
View this message in context: 
http://lucene.472066.n3.nabble.com/MultiValued-facet-behavior-question-tp3093851p4022375.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: MultiValued facet behavior question

2011-07-24 Thread William Bell
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=CardiologistdefType=dismaxqf=specialties^1.0
name^2.0facet=truefacet.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


Re: MultiValued facet behavior question

2011-06-26 Thread Chris Hostetter

: And I click on B, does it make sense for the user to display
: B
: C
: E
: 
: after the selection ? Just because items in B are C and E items as well?
: As A user I chose B because I'm interested in B items. I do not care if they
: are also C and E items.
: Technically this is correct, but functional wise, the user doesn't care
: because it is not what they searched for.

if that's how you want your UI to behavior, then it should be trivial to 
say once the user clicks on a constraint in the $fieldName field, stop 
displaying facets for $fieldName -- ie: if you add 
fq=$fieldName:fieldValue to your URL, then don't add 
facet.field=$fieldName to that same URL.

If you want the same behavior anytime the users query inadvertantly 
*happens* to be a query that only matches one of many values in a 
mutifaceted field (ie: the user searches for brown hair and all brown 
haired docors just happen to be cardiologiests) then you can still deal 
with this in your UI code by implementing logic such as: 

  * check the numFound for the main query
  * for each facet:
* for each constraint:
  * if the constraint count is the same as numFound, skip this facet


-Hoss


Re: MultiValued facet behavior question

2011-06-22 Thread Dennis de Boer
Hi Bill,

yes, you absolutely do make sense. I posted the exact same question to this
mailing list (subject: faceting on multivalued fields), but got no response
out of it. A friend of mine is now helping out.

I hope someone on the list can give us some advice. I'll post our findings
to this topic.

Regards,
Dennis


On Wed, Jun 22, 2011 at 5:37 AM, Bill Bell billnb...@gmail.com wrote:

 Doing it with q=specialities:Cardiologist or
 q=CardiologistdefType=dismaxqf=specialties
 does not matter, the issue is how I see facets. I want the facets to only
 show the one match,
 and not all the multiValued fields in specialties that match...

 Example,

 Name|specialties
 Bell|Cardiologist
 Smith|Cardiologist,Family Doctor
 Adams,Cardiologist,Family Doctor,Internist

 When I facet.field=specialties I get:

 Cardiologist: 3
 Internist: 1
 Family Doctor: 1


 I only want it to return:

 Cardiologist: 3

 Because this matches exactly... Facet on the field that matches and only
 return the number for that.

 It can get more complicated. Here is another example:

 q=cardiologydefType=dismaxqf=specialties


 (Cardiology and cardiologist are stems)...

 But I don't really know which value in Cardiologist match perfectly.

 Again, I only want it to return:

 Cardiologist: 3

 If I searched on q=internistdefType=dismaxqf=specialties, I want the
 result to be:


 Internist: 1


 Does this all make sense?







 On 6/21/11 8:23 PM, Darren Govoni dar...@ontrenet.com wrote:

 So are you saying that for all results for cardiologist,
 you don't want facets not matching Cardiologist to be
 returned as facets?
 
 what happens when you make q=specialities:Cardiologist?
 instead of just q=Cardiologist?
 
 Seems that if you make the query on the field, then all
 your results will necessarily qualify and you can discard
 any additional facets you don't want (e.g. that don't
 match the initial query term).
 
 Maybe you can write what you see now, with what you
 want to help clarify.
 
 On 06/21/2011 09:47 PM, Bill Bell wrote:
  I have a field: specialties that is multiValued.
 
  It indicates the doctor's specialties: cardiologist, internist, etc.
 
  When someone does a search: Cardiologist, I use
 
 q=cardiologistdefType=dismaxqf=specialtiesfacet=truefacet.field=speci
 alt
  ies
 
  What I want to come out in the facet is the Cardiologist (since it
 matches
  exactly) and the number that matches: 700.
  I don't want to see the other values that are not Cardiologist.
 
  Now I see:
 
  Cardiologist: 700
  Internist: 45
  Family Doctor: 20
 
  This means that several Cardiologist's are also internists and family
  doctors. When it matches exactly, I don't want to see Internists, Family
  Doctors. How do I send a query to Solr with a condition.
  Facet.query=specialties:Cardiologistfacet.field=specialties
 
  Then if the query returns something use it, otherwise use the field one?
 
  Other ideas?
 
 
 
 
 





Re: MultiValued facet behavior question

2011-06-22 Thread lee carroll
Can your front end app normalize the q parameter. Either with a drop
down or a type a head derived from the values in the specialties
field. that way q will match value(s) in your facet results. I'm not
sure what you are trying to achieve though so maybe i'm off the mark.



On 22 June 2011 04:37, Bill Bell billnb...@gmail.com wrote:
 Doing it with q=specialities:Cardiologist or
 q=CardiologistdefType=dismaxqf=specialties
 does not matter, the issue is how I see facets. I want the facets to only
 show the one match,
 and not all the multiValued fields in specialties that match...

 Example,

 Name|specialties
 Bell|Cardiologist
 Smith|Cardiologist,Family Doctor
 Adams,Cardiologist,Family Doctor,Internist

 When I facet.field=specialties I get:

 Cardiologist: 3
 Internist: 1
 Family Doctor: 1


 I only want it to return:

 Cardiologist: 3

 Because this matches exactly... Facet on the field that matches and only
 return the number for that.

 It can get more complicated. Here is another example:

 q=cardiologydefType=dismaxqf=specialties


 (Cardiology and cardiologist are stems)...

 But I don't really know which value in Cardiologist match perfectly.

 Again, I only want it to return:

 Cardiologist: 3

 If I searched on q=internistdefType=dismaxqf=specialties, I want the
 result to be:


 Internist: 1


 Does this all make sense?







 On 6/21/11 8:23 PM, Darren Govoni dar...@ontrenet.com wrote:

So are you saying that for all results for cardiologist,
you don't want facets not matching Cardiologist to be
returned as facets?

what happens when you make q=specialities:Cardiologist?
instead of just q=Cardiologist?

Seems that if you make the query on the field, then all
your results will necessarily qualify and you can discard
any additional facets you don't want (e.g. that don't
match the initial query term).

Maybe you can write what you see now, with what you
want to help clarify.

On 06/21/2011 09:47 PM, Bill Bell wrote:
 I have a field: specialties that is multiValued.

 It indicates the doctor's specialties: cardiologist, internist, etc.

 When someone does a search: Cardiologist, I use

q=cardiologistdefType=dismaxqf=specialtiesfacet=truefacet.field=speci
alt
 ies

 What I want to come out in the facet is the Cardiologist (since it
matches
 exactly) and the number that matches: 700.
 I don't want to see the other values that are not Cardiologist.

 Now I see:

 Cardiologist: 700
 Internist: 45
 Family Doctor: 20

 This means that several Cardiologist's are also internists and family
 doctors. When it matches exactly, I don't want to see Internists, Family
 Doctors. How do I send a query to Solr with a condition.
 Facet.query=specialties:Cardiologistfacet.field=specialties

 Then if the query returns something use it, otherwise use the field one?

 Other ideas?










Re: MultiValued facet behavior question

2011-06-22 Thread lee carroll
Oh sorry forgot to also type:
Often facet fields are not stemmed or heavily analysed. The facet
values are from the index.


On 22 June 2011 08:21, lee carroll lee.a.carr...@googlemail.com wrote:
 Can your front end app normalize the q parameter. Either with a drop
 down or a type a head derived from the values in the specialties
 field. that way q will match value(s) in your facet results. I'm not
 sure what you are trying to achieve though so maybe i'm off the mark.



 On 22 June 2011 04:37, Bill Bell billnb...@gmail.com wrote:
 Doing it with q=specialities:Cardiologist or
 q=CardiologistdefType=dismaxqf=specialties
 does not matter, the issue is how I see facets. I want the facets to only
 show the one match,
 and not all the multiValued fields in specialties that match...

 Example,

 Name|specialties
 Bell|Cardiologist
 Smith|Cardiologist,Family Doctor
 Adams,Cardiologist,Family Doctor,Internist

 When I facet.field=specialties I get:

 Cardiologist: 3
 Internist: 1
 Family Doctor: 1


 I only want it to return:

 Cardiologist: 3

 Because this matches exactly... Facet on the field that matches and only
 return the number for that.

 It can get more complicated. Here is another example:

 q=cardiologydefType=dismaxqf=specialties


 (Cardiology and cardiologist are stems)...

 But I don't really know which value in Cardiologist match perfectly.

 Again, I only want it to return:

 Cardiologist: 3

 If I searched on q=internistdefType=dismaxqf=specialties, I want the
 result to be:


 Internist: 1


 Does this all make sense?







 On 6/21/11 8:23 PM, Darren Govoni dar...@ontrenet.com wrote:

So are you saying that for all results for cardiologist,
you don't want facets not matching Cardiologist to be
returned as facets?

what happens when you make q=specialities:Cardiologist?
instead of just q=Cardiologist?

Seems that if you make the query on the field, then all
your results will necessarily qualify and you can discard
any additional facets you don't want (e.g. that don't
match the initial query term).

Maybe you can write what you see now, with what you
want to help clarify.

On 06/21/2011 09:47 PM, Bill Bell wrote:
 I have a field: specialties that is multiValued.

 It indicates the doctor's specialties: cardiologist, internist, etc.

 When someone does a search: Cardiologist, I use

q=cardiologistdefType=dismaxqf=specialtiesfacet=truefacet.field=speci
alt
 ies

 What I want to come out in the facet is the Cardiologist (since it
matches
 exactly) and the number that matches: 700.
 I don't want to see the other values that are not Cardiologist.

 Now I see:

 Cardiologist: 700
 Internist: 45
 Family Doctor: 20

 This means that several Cardiologist's are also internists and family
 doctors. When it matches exactly, I don't want to see Internists, Family
 Doctors. How do I send a query to Solr with a condition.
 Facet.query=specialties:Cardiologistfacet.field=specialties

 Then if the query returns something use it, otherwise use the field one?

 Other ideas?











Re: MultiValued facet behavior question

2011-06-22 Thread Michael Kuhlmann
Am 22.06.2011 05:37, schrieb Bill Bell:
 It can get more complicated. Here is another example:
 
 q=cardiologydefType=dismaxqf=specialties
 
 
 (Cardiology and cardiologist are stems)...
 
 But I don't really know which value in Cardiologist match perfectly.
 
 Again, I only want it to return:
 
 Cardiologist: 3

You would never get Cardiologist: 3 as the facet result, because if
Cardiologist would be in your index, it's impossible to find it when
searching for cardiology (except when you manage to write some strange
tokenizer that translates cardiology to Cardiologist on query time,
including the upper case letter).

Facets are always taken from the index, so they usually match exactly or
never when querying for it.

-Kuli


Re: MultiValued facet behavior question

2011-06-22 Thread Bill Bell
Here is an example using exampledocs and trunk 4.0:

http://localhost:8983/solr/select/?q=cat:%22hard%20drive%22version=2.2sta
rt=0rows=10indent=onfacet=truefacet.field=catfacet.query={!lucene}cat:
%22hard%20drive%22facet.mincount=1

Results:

result name=response numFound=2 start=0
Etc
lst name=facet_queries
int name={!lucene}cat:hard drive2/int
/lst
lst name=facet_fields
lst name=cat
int name=electronics2/int
int name=hard drive2/int
/lst/lst

Notice that the facet_queries count 2 is the same as the the numFound=2.

But I have no way to use facet.field to count the matches.

The algorithm -

Loop through multiValued field and match on hard drive. Ignore other
values in there when setting the facet list




On 6/22/11 1:19 AM, Dennis de Boer datdeb...@gmail.com wrote:

Hi Bill,

yes, you absolutely do make sense. I posted the exact same question to
this
mailing list (subject: faceting on multivalued fields), but got no
response
out of it. A friend of mine is now helping out.

I hope someone on the list can give us some advice. I'll post our findings
to this topic.

Regards,
Dennis


On Wed, Jun 22, 2011 at 5:37 AM, Bill Bell billnb...@gmail.com wrote:

 Doing it with q=specialities:Cardiologist or
 q=CardiologistdefType=dismaxqf=specialties
 does not matter, the issue is how I see facets. I want the facets to
only
 show the one match,
 and not all the multiValued fields in specialties that match...

 Example,

 Name|specialties
 Bell|Cardiologist
 Smith|Cardiologist,Family Doctor
 Adams,Cardiologist,Family Doctor,Internist

 When I facet.field=specialties I get:

 Cardiologist: 3
 Internist: 1
 Family Doctor: 1


 I only want it to return:

 Cardiologist: 3

 Because this matches exactly... Facet on the field that matches and only
 return the number for that.

 It can get more complicated. Here is another example:

 q=cardiologydefType=dismaxqf=specialties


 (Cardiology and cardiologist are stems)...

 But I don't really know which value in Cardiologist match perfectly.

 Again, I only want it to return:

 Cardiologist: 3

 If I searched on q=internistdefType=dismaxqf=specialties, I want the
 result to be:


 Internist: 1


 Does this all make sense?







 On 6/21/11 8:23 PM, Darren Govoni dar...@ontrenet.com wrote:

 So are you saying that for all results for cardiologist,
 you don't want facets not matching Cardiologist to be
 returned as facets?
 
 what happens when you make q=specialities:Cardiologist?
 instead of just q=Cardiologist?
 
 Seems that if you make the query on the field, then all
 your results will necessarily qualify and you can discard
 any additional facets you don't want (e.g. that don't
 match the initial query term).
 
 Maybe you can write what you see now, with what you
 want to help clarify.
 
 On 06/21/2011 09:47 PM, Bill Bell wrote:
  I have a field: specialties that is multiValued.
 
  It indicates the doctor's specialties: cardiologist, internist, etc.
 
  When someone does a search: Cardiologist, I use
 
 
q=cardiologistdefType=dismaxqf=specialtiesfacet=truefacet.field=spe
ci
 alt
  ies
 
  What I want to come out in the facet is the Cardiologist (since it
 matches
  exactly) and the number that matches: 700.
  I don't want to see the other values that are not Cardiologist.
 
  Now I see:
 
  Cardiologist: 700
  Internist: 45
  Family Doctor: 20
 
  This means that several Cardiologist's are also internists and family
  doctors. When it matches exactly, I don't want to see Internists,
Family
  Doctors. How do I send a query to Solr with a condition.
  Facet.query=specialties:Cardiologistfacet.field=specialties
 
  Then if the query returns something use it, otherwise use the field
one?
 
  Other ideas?
 
 
 
 
 







Re: MultiValued facet behavior question

2011-06-22 Thread Bill Bell
You can type q=cardiology and match on cardiologist. If stemming did not
work you can just add a synonym:

cardiology,cardiologist

But that is not the issue. The issue is around multiValue fields and
facets. You would expect a user
Who is searching on the multiValued field to match on some values in
there. For example,
they type Cardiologist and it matches on the value Cardiologist. So it
matches in the multiValue field.
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?


On 6/22/11 1:42 AM, Michael Kuhlmann s...@kuli.org wrote:

Am 22.06.2011 05:37, schrieb Bill Bell:
 It can get more complicated. Here is another example:
 
 q=cardiologydefType=dismaxqf=specialties
 
 
 (Cardiology and cardiologist are stems)...
 
 But I don't really know which value in Cardiologist match perfectly.
 
 Again, I only want it to return:
 
 Cardiologist: 3

You would never get Cardiologist: 3 as the facet result, because if
Cardiologist would be in your index, it's impossible to find it when
searching for cardiology (except when you manage to write some strange
tokenizer that translates cardiology to Cardiologist on query time,
including the upper case letter).

Facets are always taken from the index, so they usually match exactly or
never when querying for it.

-Kuli




Re: MultiValued facet behavior question

2011-06-22 Thread lee carroll
Hi Bill, can you explain a little bit more around why you need this.
Knowing the motivation
might suggest a different solution not just involving faceting.



On 22 June 2011 08:49, Bill Bell billnb...@gmail.com wrote:
 You can type q=cardiology and match on cardiologist. If stemming did not
 work you can just add a synonym:

 cardiology,cardiologist

 But that is not the issue. The issue is around multiValue fields and
 facets. You would expect a user
 Who is searching on the multiValued field to match on some values in
 there. For example,
 they type Cardiologist and it matches on the value Cardiologist. So it
 matches in the multiValue field.
 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?


 On 6/22/11 1:42 AM, Michael Kuhlmann s...@kuli.org wrote:

Am 22.06.2011 05:37, schrieb Bill Bell:
 It can get more complicated. Here is another example:

 q=cardiologydefType=dismaxqf=specialties


 (Cardiology and cardiologist are stems)...

 But I don't really know which value in Cardiologist match perfectly.

 Again, I only want it to return:

 Cardiologist: 3

You would never get Cardiologist: 3 as the facet result, because if
Cardiologist would be in your index, it's impossible to find it when
searching for cardiology (except when you manage to write some strange
tokenizer that translates cardiology to Cardiologist on query time,
including the upper case letter).

Facets are always taken from the index, so they usually match exactly or
never when querying for it.

-Kuli





Re: MultiValued facet behavior question

2011-06-22 Thread Dennis de Boer
Hi Bill,

as far as I understood now, with the help of my friend, you can't.
Multivalued fields don't work that way.
You can however always filter the facet results manually in the JSP. You
knwo what the user chose as a facet.

The issue I ran into is when you have additional facet fields. For example
when you also have country as a facetfield. Now when you search for
Cardiologist, it also returns Internist and family doctor as you described.
What Sorl now also returns for the country list are the countries for
Cardiologist, but also for Internist  and family doctor. This is not what
you want.

I don't think what we want her is supported out of the box by solr.


Regards,
Dennis


On Wed, Jun 22, 2011 at 9:49 AM, Bill Bell billnb...@gmail.com wrote:

 You can type q=cardiology and match on cardiologist. If stemming did not
 work you can just add a synonym:

 cardiology,cardiologist

 But that is not the issue. The issue is around multiValue fields and
 facets. You would expect a user
 Who is searching on the multiValued field to match on some values in
 there. For example,
 they type Cardiologist and it matches on the value Cardiologist. So it
 matches in the multiValue field.
 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?


 On 6/22/11 1:42 AM, Michael Kuhlmann s...@kuli.org wrote:

 Am 22.06.2011 05:37, schrieb Bill Bell:
  It can get more complicated. Here is another example:
 
  q=cardiologydefType=dismaxqf=specialties
 
 
  (Cardiology and cardiologist are stems)...
 
  But I don't really know which value in Cardiologist match perfectly.
 
  Again, I only want it to return:
 
  Cardiologist: 3
 
 You would never get Cardiologist: 3 as the facet result, because if
 Cardiologist would be in your index, it's impossible to find it when
 searching for cardiology (except when you manage to write some strange
 tokenizer that translates cardiology to Cardiologist on query time,
 including the upper case letter).
 
 Facets are always taken from the index, so they usually match exactly or
 never when querying for it.
 
 -Kuli





Re: MultiValued facet behavior question

2011-06-22 Thread Michael Kuhlmann
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


Re: MultiValued facet behavior question

2011-06-22 Thread lee carroll
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



Re: MultiValued facet behavior question

2011-06-22 Thread Dennis de Boer
Hi Lee,

since I have the same problem, I might as well try to answer this question.

You want this behaviour to make things clear for your users. If they select
cardiologists, does it make sense to also show family doctors as a
facetvalue to the user.
The same thing goed for the facets that are related to family doctors. They
are returned as well, thus making it even moren unclear for the end-user.



On Wed, Jun 22, 2011 at 2:27 PM, lee carroll
lee.a.carr...@googlemail.comwrote:

 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
 



Re: MultiValued facet behavior question

2011-06-22 Thread Mike Sokolov


On 06/22/2011 04:01 AM, Dennis de Boer wrote:

Hi Bill,

as far as I understood now, with the help of my friend, you can't.
Multivalued fields don't work that way.
You can however always filter the facet results manually in the JSP. You
knwo what the user chose as a facet.
   
Yes - that is the most sensible suggestion: if you want to display the 
facets the user chose, and only those, regardless of what was found in 
the index, then I think you know what to do!

The issue I ran into is when you have additional facet fields. For example
when you also have country as a facetfield. Now when you search for
Cardiologist, it also returns Internist and family doctor as you described.
What Sorl now also returns for the country list are the countries for
Cardiologist, but also for Internist  and family doctor. This is not what
you want.
   
I don't think this is accurate.  Your query matches some set of 
documents - the facet values shown will only be those that occur in that 
set.  If some internist's countries are shown when the user selects 
Cardiologist, that is because those internists are aldo cardiologists, 
right?


-Mike


Re: MultiValued facet behavior question

2011-06-22 Thread lee carroll
Hi Dennis,

I think maybe I just disagree. Your not showing facet counts for
cardiologists and Family Doctors independently. The Family Doctor
count will be all Family Doctors who are also Cardiologists.

This allows users to further filter Cardiologists who are also family
Doctors. (this could be of use to them ??)

If your front end app implements the filtering as a list of fq=xxx
then that would make for consistent results ?

I don't see how not showing that some cardiologists are also Family
Doctors is a better user experience... But again you might have a very
specific use case?

On 22 June 2011 13:44, Dennis de Boer datdeb...@gmail.com wrote:
 Hi Lee,

 since I have the same problem, I might as well try to answer this question.

 You want this behaviour to make things clear for your users. If they select
 cardiologists, does it make sense to also show family doctors as a
 facetvalue to the user.
 The same thing goed for the facets that are related to family doctors. They
 are returned as well, thus making it even moren unclear for the end-user.



 On Wed, Jun 22, 2011 at 2:27 PM, lee carroll
 lee.a.carr...@googlemail.comwrote:

 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
 




Re: MultiValued facet behavior question

2011-06-22 Thread Dennis de Boer
Well, the use case is rather simple. It is not a use case but more auser
experience.

If I have a list of values I can facet on, for example :
A
B
C
D
E

And I click on B, does it make sense for the user to display
B
C
E

after the selection ? Just because items in B are C and E items as well?
As A user I chose B because I'm interested in B items. I do not care if they
are also C and E items.
Technically this is correct, but functional wise, the user doesn't care
because it is not what they searched for.

In this case they were searching for a Cardiologists. Do I care that a
cardiologist is also a family doctor? No. So I also do not want to see this
as a facet value presented to me in frontend logic.
In the item details you can show that the cardiologist is also a family
doctor. That is fine, but not as an availbale facet option, if you just
chose an speciality you want to filter on.

Does it make sense?


On Wed, Jun 22, 2011 at 3:31 PM, lee carroll
lee.a.carr...@googlemail.comwrote:

 Hi Dennis,

 I think maybe I just disagree. Your not showing facet counts for
 cardiologists and Family Doctors independently. The Family Doctor
 count will be all Family Doctors who are also Cardiologists.

 This allows users to further filter Cardiologists who are also family
 Doctors. (this could be of use to them ??)

 If your front end app implements the filtering as a list of fq=xxx
 then that would make for consistent results ?

 I don't see how not showing that some cardiologists are also Family
 Doctors is a better user experience... But again you might have a very
 specific use case?

 On 22 June 2011 13:44, Dennis de Boer datdeb...@gmail.com wrote:
  Hi Lee,
 
  since I have the same problem, I might as well try to answer this
 question.
 
  You want this behaviour to make things clear for your users. If they
 select
  cardiologists, does it make sense to also show family doctors as a
  facetvalue to the user.
  The same thing goed for the facets that are related to family doctors.
 They
  are returned as well, thus making it even moren unclear for the end-user.
 
 
 
  On Wed, Jun 22, 2011 at 2:27 PM, lee carroll
  lee.a.carr...@googlemail.comwrote:
 
  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
  
 
 



RE: MultiValued facet behavior question

2011-06-22 Thread Bob Sandiford
 the facet field name.
3) You'll want to read up on the MemoryIndex class to see more about how it 
works, rather than me re-iterating that here.

[1] Caveats
1) We didn't do anything with the date type faceting, or with any ranges.
2) We didn't do anything with Facet prefix handling - it may or may not work if 
you need prefixes.
3) Anything else that facets do that we didn't handle - or at least, didn't 
test :)  As I say, it's a very special case for us, and this is in no way 
intended to be a general solution or fit for 'prime time' submission as a Solr 
enhancement.

Bob Sandiford | Lead Software Engineer | SirsiDynix
P: 800.288.8020 X6943 | bob.sandif...@sirsidynix.com
www.sirsidynix.com

 -Original Message-
 From: Bill Bell [mailto:billnb...@gmail.com]
 Sent: Wednesday, June 22, 2011 3:49 AM
 To: solr-user@lucene.apache.org
 Subject: Re: MultiValued facet behavior question
 
 You can type q=cardiology and match on cardiologist. If stemming did
 not
 work you can just add a synonym:
 
 cardiology,cardiologist
 
 But that is not the issue. The issue is around multiValue fields and
 facets. You would expect a user
 Who is searching on the multiValued field to match on some values in
 there. For example,
 they type Cardiologist and it matches on the value Cardiologist. So
 it
 matches in the multiValue field.
 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?
 
 
 On 6/22/11 1:42 AM, Michael Kuhlmann s...@kuli.org wrote:
 
 Am 22.06.2011 05:37, schrieb Bill Bell:
  It can get more complicated. Here is another example:
 
  q=cardiologydefType=dismaxqf=specialties
 
 
  (Cardiology and cardiologist are stems)...
 
  But I don't really know which value in Cardiologist match perfectly.
 
  Again, I only want it to return:
 
  Cardiologist: 3
 
 You would never get Cardiologist: 3 as the facet result, because if
 Cardiologist would be in your index, it's impossible to find it when
 searching for cardiology (except when you manage to write some
 strange
 tokenizer that translates cardiology to Cardiologist on query
 time,
 including the upper case letter).
 
 Facets are always taken from the index, so they usually match exactly
 or
 never when querying for it.
 
 -Kuli
 
 




Re: MultiValued facet behavior question

2011-06-22 Thread Mike Sokolov
We always remove the facet filter when faceting: in other words, for a 
good user experience, you generally want to show facets based on the 
query excluding any restriction based on the facets.
So in your example (facet B selected), we would continue to show *all* 
facets.  Only if you performed a search using some other filter 
(proximity, gender, etc), would we restrict the facet list.


-Mike

On 06/22/2011 09:42 AM, Dennis de Boer wrote:

Well, the use case is rather simple. It is not a use case but more auser
experience.

If I have a list of values I can facet on, for example :
A
B
C
D
E

And I click on B, does it make sense for the user to display
B
C
E

after the selection ? Just because items in B are C and E items as well?
As A user I chose B because I'm interested in B items. I do not care if they
are also C and E items.
Technically this is correct, but functional wise, the user doesn't care
because it is not what they searched for.

In this case they were searching for a Cardiologists. Do I care that a
cardiologist is also a family doctor? No. So I also do not want to see this
as a facet value presented to me in frontend logic.
In the item details you can show that the cardiologist is also a family
doctor. That is fine, but not as an availbale facet option, if you just
chose an speciality you want to filter on.

Does it make sense?


On Wed, Jun 22, 2011 at 3:31 PM, lee carroll
lee.a.carr...@googlemail.comwrote:

   

Hi Dennis,

I think maybe I just disagree. Your not showing facet counts for
cardiologists and Family Doctors independently. The Family Doctor
count will be all Family Doctors who are also Cardiologists.

This allows users to further filter Cardiologists who are also family
Doctors. (this could be of use to them ??)

If your front end app implements the filtering as a list of fq=xxx
then that would make for consistent results ?

I don't see how not showing that some cardiologists are also Family
Doctors is a better user experience... But again you might have a very
specific use case?

On 22 June 2011 13:44, Dennis de Boerdatdeb...@gmail.com  wrote:
 

Hi Lee,

since I have the same problem, I might as well try to answer this
   

question.
 

You want this behaviour to make things clear for your users. If they
   

select
 

cardiologists, does it make sense to also show family doctors as a
facetvalue to the user.
The same thing goed for the facets that are related to family doctors.
   

They
 

are returned as well, thus making it even moren unclear for the end-user.



On Wed, Jun 22, 2011 at 2:27 PM, lee carroll
lee.a.carr...@googlemail.comwrote:

   

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 Kuhlmanns...@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

   
 
   
 
   


Re: MultiValued facet behavior question

2011-06-22 Thread Darren Govoni
How is that different from doing a field search and just counting the 
results?

If you only want the facet of the searched term (input), then why not just
combine that with the result count and use that?

Facets are more useful when you _don't_ know the distribution of values
across a result set because they weren't included in the search criteria.

Maybe this needs a new name or handler than facet.

What am I missing?

On 06/22/2011 03:44 AM, Bill Bell wrote:

Here is an example using exampledocs and trunk 4.0:

http://localhost:8983/solr/select/?q=cat:%22hard%20drive%22version=2.2sta
rt=0rows=10indent=onfacet=truefacet.field=catfacet.query={!lucene}cat:
%22hard%20drive%22facet.mincount=1

Results:

result name=response numFound=2 start=0
Etc
lst name=facet_queries
int name={!lucene}cat:hard drive2/int
/lst
lst name=facet_fields
lst name=cat
 int name=electronics2/int
 int name=hard drive2/int
/lst/lst

Notice that the facet_queries count 2 is the same as the the numFound=2.

But I have no way to use facet.field to count the matches.

The algorithm -

Loop through multiValued field and match on hard drive. Ignore other
values in there when setting the facet list




On 6/22/11 1:19 AM, Dennis de Boerdatdeb...@gmail.com  wrote:


Hi Bill,

yes, you absolutely do make sense. I posted the exact same question to
this
mailing list (subject: faceting on multivalued fields), but got no
response
out of it. A friend of mine is now helping out.

I hope someone on the list can give us some advice. I'll post our findings
to this topic.

Regards,
Dennis


On Wed, Jun 22, 2011 at 5:37 AM, Bill Bellbillnb...@gmail.com  wrote:


Doing it with q=specialities:Cardiologist or
q=CardiologistdefType=dismaxqf=specialties
does not matter, the issue is how I see facets. I want the facets to
only
show the one match,
and not all the multiValued fields in specialties that match...

Example,

Name|specialties
Bell|Cardiologist
Smith|Cardiologist,Family Doctor
Adams,Cardiologist,Family Doctor,Internist

When I facet.field=specialties I get:

Cardiologist: 3
Internist: 1
Family Doctor: 1


I only want it to return:

Cardiologist: 3

Because this matches exactly... Facet on the field that matches and only
return the number for that.

It can get more complicated. Here is another example:

q=cardiologydefType=dismaxqf=specialties


(Cardiology and cardiologist are stems)...

But I don't really know which value in Cardiologist match perfectly.

Again, I only want it to return:

Cardiologist: 3

If I searched on q=internistdefType=dismaxqf=specialties, I want the
result to be:


Internist: 1


Does this all make sense?







On 6/21/11 8:23 PM, Darren Govonidar...@ontrenet.com  wrote:


So are you saying that for all results for cardiologist,
you don't want facets not matching Cardiologist to be
returned as facets?

what happens when you make q=specialities:Cardiologist?
instead of just q=Cardiologist?

Seems that if you make the query on the field, then all
your results will necessarily qualify and you can discard
any additional facets you don't want (e.g. that don't
match the initial query term).

Maybe you can write what you see now, with what you
want to help clarify.

On 06/21/2011 09:47 PM, Bill Bell wrote:

I have a field: specialties that is multiValued.

It indicates the doctor's specialties: cardiologist, internist, etc.

When someone does a search: Cardiologist, I use

q=cardiologistdefType=dismaxqf=specialtiesfacet=truefacet.field=spe
ci
alt
ies

What I want to come out in the facet is the Cardiologist (since it
matches
exactly) and the number that matches: 700.
I don't want to see the other values that are not Cardiologist.

Now I see:

Cardiologist: 700
Internist: 45
Family Doctor: 20

This means that several Cardiologist's are also internists and family
doctors. When it matches exactly, I don't want to see Internists,

Family

Doctors. How do I send a query to Solr with a condition.
Facet.query=specialties:Cardiologistfacet.field=specialties

Then if the query returns something use it, otherwise use the field

one?

Other ideas?













Re: MultiValued facet behavior question

2011-06-22 Thread Jonathan Rochkind
Okay, so since you put cardiologist in the 'q', you only want facet 
values that have 'cardiologist' (or 'Cardiologist') to show in up the 
facet list.


In general, there's no good way to do that.

But.

If you want to do some client-side processing before you submit the 
query to Solr, and on the client side you can figure out exactly what 
you want: then you could try to play around with facet.filter or 
facet.query, to see if you can make it do what you want. It may or may 
not work out, depending on exactly your use pattern, which you still 
haven't articulated very well, but you can mess around with it and see 
what you can do.


Ie, if you KNOW (that is, your own app code knows, when creating the 
Solr request) that you only want the facet value for Cardiologist 
(including exact case), you can try facet.query=specialty:Cardiologist


Your app code would have to pull out the results special too, they won't 
be in the Solr response in same way ordinary facet.field is. It also 
requires your query value to match _exactly_ (case, punctuation, etc) 
the value in the index. Not cardiologist and Cardiologist.


I think Solr 3.1 has some regex based facet.filter abilities that might 
be useful, and help you get around the 'exact match' issues, but watch 
out for performance.





On 6/21/2011 11:37 PM, Bill Bell wrote:

Doing it with q=specialities:Cardiologist or
q=CardiologistdefType=dismaxqf=specialties
does not matter, the issue is how I see facets. I want the facets to only
show the one match,
and not all the multiValued fields in specialties that match...

Example,

Name|specialties
Bell|Cardiologist
Smith|Cardiologist,Family Doctor
Adams,Cardiologist,Family Doctor,Internist

When I facet.field=specialties I get:

Cardiologist: 3
Internist: 1
Family Doctor: 1


I only want it to return:

Cardiologist: 3

Because this matches exactly... Facet on the field that matches and only
return the number for that.

It can get more complicated. Here is another example:

q=cardiologydefType=dismaxqf=specialties


(Cardiology and cardiologist are stems)...

But I don't really know which value in Cardiologist match perfectly.

Again, I only want it to return:

Cardiologist: 3

If I searched on q=internistdefType=dismaxqf=specialties, I want the
result to be:


Internist: 1


Does this all make sense?







On 6/21/11 8:23 PM, Darren Govonidar...@ontrenet.com  wrote:


So are you saying that for all results for cardiologist,
you don't want facets not matching Cardiologist to be
returned as facets?

what happens when you make q=specialities:Cardiologist?
instead of just q=Cardiologist?

Seems that if you make the query on the field, then all
your results will necessarily qualify and you can discard
any additional facets you don't want (e.g. that don't
match the initial query term).

Maybe you can write what you see now, with what you
want to help clarify.

On 06/21/2011 09:47 PM, Bill Bell wrote:

I have a field: specialties that is multiValued.

It indicates the doctor's specialties: cardiologist, internist, etc.

When someone does a search: Cardiologist, I use

q=cardiologistdefType=dismaxqf=specialtiesfacet=truefacet.field=speci
alt
ies

What I want to come out in the facet is the Cardiologist (since it
matches
exactly) and the number that matches: 700.
I don't want to see the other values that are not Cardiologist.

Now I see:

Cardiologist: 700
Internist: 45
Family Doctor: 20

This means that several Cardiologist's are also internists and family
doctors. When it matches exactly, I don't want to see Internists, Family
Doctors. How do I send a query to Solr with a condition.
Facet.query=specialties:Cardiologistfacet.field=specialties

Then if the query returns something use it, otherwise use the field one?

Other ideas?









Re: MultiValued facet behavior question

2011-06-22 Thread Darren Govoni

Yeah, I agree with that last statement.

It seems to me that the use case where it _might_ matter is where
you have a query for MORE than one.

q=cardiologist OR family

and in that case, it MIGHT be useful to separate the facets
in a XOR sense where you don't get cross-pollution. But
the original poster didn't indicate this scenario originally.

Maybe for that, Solr's grouping mechanism will help?
Although I have not used it myself.

On 06/22/2011 09:31 AM, lee carroll wrote:

Hi Dennis,

I think maybe I just disagree. Your not showing facet counts for
cardiologists and Family Doctors independently. The Family Doctor
count will be all Family Doctors who are also Cardiologists.

This allows users to further filter Cardiologists who are also family
Doctors. (this could be of use to them ??)

If your front end app implements the filtering as a list of fq=xxx
then that would make for consistent results ?

I don't see how not showing that some cardiologists are also Family
Doctors is a better user experience... But again you might have a very
specific use case?

On 22 June 2011 13:44, Dennis de Boerdatdeb...@gmail.com  wrote:

Hi Lee,

since I have the same problem, I might as well try to answer this question.

You want this behaviour to make things clear for your users. If they select
cardiologists, does it make sense to also show family doctors as a
facetvalue to the user.
The same thing goed for the facets that are related to family doctors. They
are returned as well, thus making it even moren unclear for the end-user.



On Wed, Jun 22, 2011 at 2:27 PM, lee carroll
lee.a.carr...@googlemail.comwrote:


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 Kuhlmanns...@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





Re: MultiValued facet behavior question

2011-06-22 Thread Gino Rodrigues
An interesting live scenario for this matter:
http://www.bondfaro.com.br/  (brazilian site)

The query ipad returns results spread across many categories (links
on the left, teasers in the center). The Tablet category (facet) is
one of them.

The query tablet does exactly the same as clicking Tablet in the
search for ipad. Note the breadcrumb
(InícioInformáticaTablettablet)

In this case of a broad term, that exactly matches a product facet, it
totally makes sense for the user. In general, it tends to make more
sense as the search bias from full-text to structured metadata.

So, is it possible to turn q=cardiologist into
q=specialities:Cardiologist by boosting an exact match on a facet
label?


Re: MultiValued facet behavior question

2011-06-21 Thread Darren Govoni

So are you saying that for all results for cardiologist,
you don't want facets not matching Cardiologist to be
returned as facets?

what happens when you make q=specialities:Cardiologist?
instead of just q=Cardiologist?

Seems that if you make the query on the field, then all
your results will necessarily qualify and you can discard
any additional facets you don't want (e.g. that don't
match the initial query term).

Maybe you can write what you see now, with what you
want to help clarify.

On 06/21/2011 09:47 PM, Bill Bell wrote:

I have a field: specialties that is multiValued.

It indicates the doctor's specialties: cardiologist, internist, etc.

When someone does a search: Cardiologist, I use
q=cardiologistdefType=dismaxqf=specialtiesfacet=truefacet.field=specialt
ies

What I want to come out in the facet is the Cardiologist (since it matches
exactly) and the number that matches: 700.
I don't want to see the other values that are not Cardiologist.

Now I see:

Cardiologist: 700
Internist: 45
Family Doctor: 20

This means that several Cardiologist's are also internists and family
doctors. When it matches exactly, I don't want to see Internists, Family
Doctors. How do I send a query to Solr with a condition.
Facet.query=specialties:Cardiologistfacet.field=specialties

Then if the query returns something use it, otherwise use the field one?

Other ideas?








Re: MultiValued facet behavior question

2011-06-21 Thread Bill Bell
Doing it with q=specialities:Cardiologist or
q=CardiologistdefType=dismaxqf=specialties
does not matter, the issue is how I see facets. I want the facets to only
show the one match,
and not all the multiValued fields in specialties that match...

Example,

Name|specialties
Bell|Cardiologist
Smith|Cardiologist,Family Doctor
Adams,Cardiologist,Family Doctor,Internist

When I facet.field=specialties I get:

Cardiologist: 3
Internist: 1
Family Doctor: 1


I only want it to return:

Cardiologist: 3

Because this matches exactly... Facet on the field that matches and only
return the number for that.

It can get more complicated. Here is another example:

q=cardiologydefType=dismaxqf=specialties


(Cardiology and cardiologist are stems)...

But I don't really know which value in Cardiologist match perfectly.

Again, I only want it to return:

Cardiologist: 3

If I searched on q=internistdefType=dismaxqf=specialties, I want the
result to be:


Internist: 1


Does this all make sense?







On 6/21/11 8:23 PM, Darren Govoni dar...@ontrenet.com wrote:

So are you saying that for all results for cardiologist,
you don't want facets not matching Cardiologist to be
returned as facets?

what happens when you make q=specialities:Cardiologist?
instead of just q=Cardiologist?

Seems that if you make the query on the field, then all
your results will necessarily qualify and you can discard
any additional facets you don't want (e.g. that don't
match the initial query term).

Maybe you can write what you see now, with what you
want to help clarify.

On 06/21/2011 09:47 PM, Bill Bell wrote:
 I have a field: specialties that is multiValued.

 It indicates the doctor's specialties: cardiologist, internist, etc.

 When someone does a search: Cardiologist, I use
 
q=cardiologistdefType=dismaxqf=specialtiesfacet=truefacet.field=speci
alt
 ies

 What I want to come out in the facet is the Cardiologist (since it
matches
 exactly) and the number that matches: 700.
 I don't want to see the other values that are not Cardiologist.

 Now I see:

 Cardiologist: 700
 Internist: 45
 Family Doctor: 20

 This means that several Cardiologist's are also internists and family
 doctors. When it matches exactly, I don't want to see Internists, Family
 Doctors. How do I send a query to Solr with a condition.
 Facet.query=specialties:Cardiologistfacet.field=specialties

 Then if the query returns something use it, otherwise use the field one?

 Other ideas?