You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by dhanesh <dh...@hifx.net> on 2011/01/14 11:16:36 UTC

facet result issue

Hi,
I've a trouble in facet search.Here is the scenario
I've 2 districts say A and B
Under the district A, there are two cities say, x and y
and under district B, there is another two cities, say j and k

When I try to search lists under the district A, search result works fine.
Facet also worked..
But along with the facet result I got the other cities under the 
district B too with its count 0.
What I need in my facet result is the cities(x and y only) under district A.
No need to show the cities under the district B.
Anybody have any suggestions???
Regds
dhanesh

Re: facet result issue

Posted by dhanesh <dh...@hifx.net>.
Hi...
Wow..very nice..:-) :-)
It worked..
Thanks a lot.

On 1/14/2011 4:10 PM, david.dankwerth@ubs.com wrote:
> Try facet.mincount=1 , this will ensure you get only values bigger than
> 0
> So example :
> Serach to be q=district:A&facet.field=city&facet.mincount=1
>
> Or via the Java api
> SolrQuery solrQuery = new
> SolrQuery("district:A").addFacetField("city").setFacetMinCount(1)
>
>
>
> -----Original Message-----
> From: dhanesh [mailto:dhanesh@hifx.net]
> Sent: 14 January 2011 10:17
> To: solr-user@lucene.apache.org
> Subject: facet result issue
>
> Hi,
> I've a trouble in facet search.Here is the scenario I've 2 districts say
> A and B Under the district A, there are two cities say, x and y and
> under district B, there is another two cities, say j and k
>
> When I try to search lists under the district A, search result works
> fine.
> Facet also worked..
> But along with the facet result I got the other cities under the
> district B too with its count 0.
> What I need in my facet result is the cities(x and y only) under
> district A.
> No need to show the cities under the district B.
> Anybody have any suggestions???
> Regds
> dhanesh
> Visit our website at http://www.ubs.com
>
> This message contains confidential information and is intended only
> for the individual named. If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail. Please
> notify the sender immediately by e-mail if you have received this
> e-mail by mistake and delete this e-mail from your system.
>
> E-mails are not encrypted and cannot be guaranteed to be secure or
> error-free as information could be intercepted, corrupted, lost,
> destroyed, arrive late or incomplete, or contain viruses. The sender
> therefore does not accept liability for any errors or omissions in the
> contents of this message which arise as a result of e-mail transmission.
> If verification is required please request a hard-copy version. This
> message is provided for informational purposes and should not be
> construed as a solicitation or offer to buy or sell any securities
> or related financial instruments.
>
> UBS Limited is a company limited by shares incorporated in the United
> Kingdom registered in England and Wales with number 2035362.
> Registered office: 1 Finsbury Avenue, London EC2M 2PP.  UBS Limited
> is authorised and regulated by the Financial Services Authority.
>
> UBS AG is a public company incorporated with limited liability in
> Switzerland domiciled in the Canton of Basel-City and the Canton of
> Zurich respectively registered at the Commercial Registry offices in
> those Cantons with Identification No: CH-270.3.004.646-4 and having
> respective head offices at Aeschenvorstadt 1, 4051 Basel and
> Bahnhofstrasse 45, 8001 Zurich, Switzerland.  Registered in the
> United Kingdom as a foreign company with No: FC021146 and having a
> UK Establishment registered at Companies House, Cardiff, with No:
> BR 004507.  The principal office of UK Establishment: 1 Finsbury Avenue,
> London EC2M 2PP.  In the United Kingdom, UBS AG is authorised and
> regulated by the Financial Services Authority.
>
> UBS reserves the right to retain all messages. Messages are protected
> and accessed only in legally justified cases.


RE: facet result issue

Posted by da...@ubs.com.
Try facet.mincount=1 , this will ensure you get only values bigger than
0 
So example :
Serach to be q=district:A&facet.field=city&facet.mincount=1 

Or via the Java api 
SolrQuery solrQuery = new
SolrQuery("district:A").addFacetField("city").setFacetMinCount(1)

 

-----Original Message-----
From: dhanesh [mailto:dhanesh@hifx.net] 
Sent: 14 January 2011 10:17
To: solr-user@lucene.apache.org
Subject: facet result issue

Hi,
I've a trouble in facet search.Here is the scenario I've 2 districts say
A and B Under the district A, there are two cities say, x and y and
under district B, there is another two cities, say j and k

When I try to search lists under the district A, search result works
fine.
Facet also worked..
But along with the facet result I got the other cities under the
district B too with its count 0.
What I need in my facet result is the cities(x and y only) under
district A.
No need to show the cities under the district B.
Anybody have any suggestions???
Regds
dhanesh
Visit our website at http://www.ubs.com 

This message contains confidential information and is intended only 
for the individual named. If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail. Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system. 

E-mails are not encrypted and cannot be guaranteed to be secure or 
error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses. The sender 
therefore does not accept liability for any errors or omissions in the 
contents of this message which arise as a result of e-mail transmission. 
If verification is required please request a hard-copy version. This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities 
or related financial instruments. 

UBS Limited is a company limited by shares incorporated in the United 
Kingdom registered in England and Wales with number 2035362. 
Registered office: 1 Finsbury Avenue, London EC2M 2PP.  UBS Limited 
is authorised and regulated by the Financial Services Authority. 

UBS AG is a public company incorporated with limited liability in 
Switzerland domiciled in the Canton of Basel-City and the Canton of 
Zurich respectively registered at the Commercial Registry offices in 
those Cantons with Identification No: CH-270.3.004.646-4 and having 
respective head offices at Aeschenvorstadt 1, 4051 Basel and 
Bahnhofstrasse 45, 8001 Zurich, Switzerland.  Registered in the 
United Kingdom as a foreign company with No: FC021146 and having a 
UK Establishment registered at Companies House, Cardiff, with No:  
BR 004507.  The principal office of UK Establishment: 1 Finsbury Avenue, 
London EC2M 2PP.  In the United Kingdom, UBS AG is authorised and 
regulated by the Financial Services Authority.

UBS reserves the right to retain all messages. Messages are protected 
and accessed only in legally justified cases.