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 Derek Poh <dp...@globalsources.com> on 2016/08/10 07:32:13 UTC

display filter based on existence of facet

I have a couple of filtersthat is text input based, where user will 
input a value into the text boxes of these filters.
The condition is these filters will only be display if the facets exists 
in the search result.
Eg. Min Order Qty filter will be displayif theMin Order Qty facet exists 
in thesolr result.

To display this filter, I only need to'know' there is value to filter on.
Currentlyall the possible terms and counts of the Min Order Qty field is 
return for this facet.

Any suggestions on how I can avoid the computation of the possible terms 
and their countsfor the facet fieldand hence reduce the computational 
time of the query?
I just need to know there is'a value to filter on'.

This is the parameters of the query that is use to display the list of 
filters.
group.field=P_SupplierId&group=true&group.facet=true&start=0&rows=0&q=coffee&fq=P_SupplierSource:(1)&facet=true&facet.mincount=1&facet.field=P_CNState&facet.field=P_BusinessType&facet.field=P_CombinedBusTypeFlat&facet.field=P_CombinedCompCertFlat&facet.field=P_CombinedExportCountryFlat&facet.field=P_CombinedProdCertFlat&facet.field=P_Country&facet.field=P_CSFParticipant&facet.field=P_FOBPriceMinFlag&facet.field=P_FOBPriceMaxFlag&facet.field=P_HasAuditInfo&facet.field=P_HasCreditInfo&facet.field=P_LeadTime&facet.field=P_Microsite&facet.field=P_MinOrderQty&facet.field=P_MonthlyCapacityFlag&facet.field=P_OEMServices&facet.field=P_PSEParticipant&facet.field=P_SupplierRanking&facet.field=P_SupplierUpcomingTradeShow&facet.field=P_YearsInBusiness&facet.field=P_SmallOrderFlag

Using solr 4.10.4

Thankyou,
Derek

----------------------
CONFIDENTIALITY NOTICE 

This e-mail (including any attachments) may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please inform the sender immediately and delete this e-mail (including any attachments) from your computer, and you must not use, disclose to anyone else or copy this e-mail (including any attachments), whether in whole or in part. 

This e-mail and any reply to it may be monitored for security, legal, regulatory compliance and/or other appropriate reasons.

Re: display filter based on existence of facet

Posted by Emir Arnautovic <em...@sematext.com>.
Hi Derek,

Not sure if there is some shortcut but you could try setting 
facet.sort=index and for sure use facet.limit=1.

Regards,
Emir

-- 
Monitoring * Alerting * Anomaly Detection * Centralized Log Management
Solr & Elasticsearch Support * http://sematext.com/


On 10.08.2016 09:32, Derek Poh wrote:
> I have a couple of filtersthat is text input based, where user will 
> input a value into the text boxes of these filters.
> The condition is these filters will only be display if the facets 
> exists in the search result.
> Eg. Min Order Qty filter will be displayif theMin Order Qty facet 
> exists in thesolr result.
>
> To display this filter, I only need to'know' there is value to filter on.
> Currentlyall the possible terms and counts of the Min Order Qty field 
> is return for this facet.
>
> Any suggestions on how I can avoid the computation of the possible 
> terms and their countsfor the facet fieldand hence reduce the 
> computational time of the query?
> I just need to know there is'a value to filter on'.
>
> This is the parameters of the query that is use to display the list of 
> filters.
> group.field=P_SupplierId&group=true&group.facet=true&start=0&rows=0&q=coffee&fq=P_SupplierSource:(1)&facet=true&facet.mincount=1&facet.field=P_CNState&facet.field=P_BusinessType&facet.field=P_CombinedBusTypeFlat&facet.field=P_CombinedCompCertFlat&facet.field=P_CombinedExportCountryFlat&facet.field=P_CombinedProdCertFlat&facet.field=P_Country&facet.field=P_CSFParticipant&facet.field=P_FOBPriceMinFlag&facet.field=P_FOBPriceMaxFlag&facet.field=P_HasAuditInfo&facet.field=P_HasCreditInfo&facet.field=P_LeadTime&facet.field=P_Microsite&facet.field=P_MinOrderQty&facet.field=P_MonthlyCapacityFlag&facet.field=P_OEMServices&facet.field=P_PSEParticipant&facet.field=P_SupplierRanking&facet.field=P_SupplierUpcomingTradeShow&facet.field=P_YearsInBusiness&facet.field=P_SmallOrderFlag 
>
>
> Using solr 4.10.4
>
> Thankyou,
> Derek
>
> ----------------------
> CONFIDENTIALITY NOTICE
> This e-mail (including any attachments) may contain confidential 
> and/or privileged information. If you are not the intended recipient 
> or have received this e-mail in error, please inform the sender 
> immediately and delete this e-mail (including any attachments) from 
> your computer, and you must not use, disclose to anyone else or copy 
> this e-mail (including any attachments), whether in whole or in part.
> This e-mail and any reply to it may be monitored for security, legal, 
> regulatory compliance and/or other appropriate reasons.