Inhalte aufrufen

Profilbild

Facet groups not showing all possible options


Best Answer Marcus Gesing , 22 January 2021 - 19:58

1. Yes, see Configuration > Settings > Search > Result filtering > Maximum number of filters
2. https://getbootstrap...nents/collapse/
Requires a reworking of \Views\Search\FacetTemplates\MultiSelect.cshtml. By default, a scroll bar appears when there are more than 7 filters.
Go to the full post


  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
5 Antworten zu diesem Thema

#1 altmoola

altmoola

    Advanced Member

  • Members
  • 58 Beiträge

Geschrieben: 22 January 2021 - 18:55

When loading certain categories of my website, it is possible to have many options inside a facet group. Right now it appears the code takes approx. the top 20 to 30 or so associated values. I'm wondering two things:

 

  1. Can I define how many options will appear in a facet group?
  2. Do you have any suggestions on how to add a link inside the facet group that just says "Show All"?


#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3614 Beiträge

Geschrieben: 22 January 2021 - 19:58   Best Answer

1. Yes, see Configuration > Settings > Search > Result filtering > Maximum number of filters
Requires a reworking of \Views\Search\FacetTemplates\MultiSelect.cshtml. By default, a scroll bar appears when there are more than 7 filters.

  • stefanmueller gefällt das

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#3 altmoola

altmoola

    Advanced Member

  • Members
  • 58 Beiträge

Geschrieben: 22 January 2021 - 20:27

To implement #2: do you suggest I increase the limit to say 500 and then rework the view so that it still shows a subset and then the Show All will show the rest (up to setting i.e. 500)?



#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3614 Beiträge

Geschrieben: 23 January 2021 - 10:36

I would leave the limit at or near 7. This has proven to be a good compromise because of the UI (the most important ones visible, but not a confusing lot). With very few filter groups, you can also increase the value. Note, a very large increase of Maximum number of filters can have an impact on performance when significantly more hits for facets have to be checked and provided.

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#5 altmoola

altmoola

    Advanced Member

  • Members
  • 58 Beiträge

Geschrieben: 02 February 2021 - 18:21

Thank you for the insight. Based on what you said, I would put the maximum to 6 so that the seventh item can be a "Show More" link (and therefore no scrollbar will show until clicked). However, I don't fully understand how I would retrieve the remaining items if someone clicked it.

 

Can you point me in the right direction so that when someone clicks the Show All X More link it would just query for the remaining items and refresh that facet group?

 

uLiMMtL.jpg



#6 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3614 Beiträge

Geschrieben: 02 February 2021 - 19:01

That will be difficult. Reload via AJAX? "Remaining items" is not possible. The search API always loads the facets of all groups, not just those where the button was clicked. So you would have to do the whole search again via AJAX, this time with a larger value for Maximum number of filters.

Schöne Grüße aus Düsseldorf,
Marcus Gesing