Fórum

How can I change the facet.limit parameter on a Faceted Search?

thumbnail
Carlos Santos, modificado 7 Anos atrás.

How can I change the facet.limit parameter on a Faceted Search?

New Member Postagens: 15 Data de Entrada: 18/09/15 Postagens Recentes
Dear all,

Please lend your precious expertise.

Slow Faceted search query I'm trying to improve performance of the faceted search on my project. For some keywords, it takes more than 20 seconds to return less than 4000 results. And this after starting using Solr. Before that it would incredibly take more than a minute.

2 queries After starting to use Solr, I could see that the Faceted search is sending 2 queries to the Search Engine:
q=%2B(%2B(companyId:10204)+%2B((%2B(entryClassName:com.liferay.portlet.documentlibrary.model.DLFileEntry)+%2B(status:0)+%2B(hidden:false))))+%2B(assetCategoryTitles:chiara*+assetCategoryTitles_en_US:chiara*+assetTagNames:chiara*+title:chiara+description:chiara+content:chiara+expando/custom_fields/space-title:chiara+expando/custom_fields/space-author:chiara*+expando/custom_fields/space-location:chiara*+expando/custom_fields/space-audience:chiara*+expando/custom_fields/space-description:chiara+expando/custom_fields/space-cross-reference:chiara)+%2BcompanyId:10204&rows=0&wt=javabin&version=2

AND
f.expando/custom_fields/space-audience.facet.sort=count&amp;hl=true&amp;hl.requireFieldMatch=true&amp;fl=*,score&amp;hl.fragsize=80&amp;f.expando/custom_fields/space-title_en_US_sortable.facet.sort=count&amp;f.expando/custom_fields/space-author.facet.sort=count&amp;hl.simple.pre=<liferay-hl>&amp;f.entryClassName.facet.sort=count&amp;f.groupId.facet.sort=count&amp;f.expando/custom_fields/space-location.facet.sort=count&amp;hl.fl=assetCategoryTitles&amp;hl.fl=assetCategoryTitles_en_US&amp;hl.fl=content&amp;hl.fl=content_en_US&amp;hl.fl=description&amp;hl.fl=description_en_US&amp;hl.fl=title&amp;hl.fl=title_en_US&amp;wt=javabin&amp;facet.field=expando/custom_fields/space-cross-reference&amp;facet.field=modified&amp;facet.field=assetCategoryIds&amp;facet.field=expando/custom_fields/space-date&amp;facet.field=entryClassName&amp;facet.field=expando/custom_fields/space-title_en_US_sortable&amp;facet.field=expando/custom_fields/space-location&amp;facet.field=groupId&amp;facet.field=expando/custom_fields/space-audience&amp;facet.field=expando/custom_fields/space-author&amp;start=0&amp;sort=score+desc&amp;rows=3584&amp;f.modified.facet.sort=count&amp;version=2&amp;hl.snippets=3&amp;facet.limit=-1&amp;q=%2B(%2B(companyId:10204)+%2B((%2B(entryClassName:com.liferay.portlet.documentlibrary.model.DLFileEntry)+%2B(status:0)+%2B(hidden:false))))+%2B(assetCategoryTitles:chiara*+assetCategoryTitles_en_US:chiara*+assetTagNames:chiara*+title:chiara+description:chiara+content:chiara+expando/custom_fields/space-title:chiara+expando/custom_fields/space-author:chiara*+expando/custom_fields/space-location:chiara*+expando/custom_fields/space-audience:chiara*+expando/custom_fields/space-description:chiara+expando/custom_fields/space-cross-reference:chiara)+%2BcompanyId:10204&amp;hl.simple.post=</liferay-hl>&amp;f.expando/custom_fields/space-date.facet.sort=count&amp;f.expando/custom_fields/space-cross-reference.facet.sort=count&amp;f.assetCategoryIds.facet.sort=count&amp;facet=true
PS: I attached the Solr log snippet for making it easier to read.

Version information I'm using Liferay 6.2 CE GA2 and Solr 4.10.4 connected via the plugin "Solr 4 Search Engine CE" from the Marketplace.

Eureka moment Applying these queries directly on the Solr administrator panel I discovered that the single parameter "facet.limit=-1" was the cause of making the query take more than a second to be processed. If we remove this parameter on change the -1 value to any number, the query is processed in less than a second.

Questions My questions are:
  • How can I change the facet.limit to 1000 or any other number?
  • Why does the Faceted Search is creating 2 queries? Is this normal?

I'm sure that with your help, this search behavior will become less mysterious to me emoticon.

Thank you and have a great day.
thumbnail
Carlos Santos, modificado 7 Anos atrás.

RE: How can I change the facet.limit parameter on a Faceted Search?

New Member Postagens: 15 Data de Entrada: 18/09/15 Postagens Recentes
Hi guys,

After some weeks trying I found the answer:
You can remove the facet.limit inside the class SolrIndexSearcher.
But it doesn't solve performance issue.
What solved in my case was to make the pagination to work. Loading only 20 results at a time.

Thank you for reading and good luck!

Best,
Carlos