pantheon-systems / solr-power

A WordPress plugin to connect to Pantheon's Apache Solr search infrastructure, or your own!
https://wordpress.org/plugins/solr-power/
GNU General Public License v2.0
126 stars 61 forks source link

Facet count #375

Open alexmakeit opened 6 years ago

alexmakeit commented 6 years ago

Is there a way to get more than 10 facet http://i.imgur.com/iSK41JP.png ?

danielbachhuber commented 6 years ago

Hi @alexmakeit,

I'm not sure I follow. Can you share the code you used to produce the screenshot, and more details about your configuration generally?

carl-alberto commented 5 years ago

Hi @danielbachhuber,

This issue might be related on the facets that is being displayed by the widget, it only shows maximum of 10. https://www.screencast.com/t/hDUtOhPk

It seems, the plugin don't have an option to change that value or a documentation to change it or override it via a filter.

Tried to manually change the wp-content/plugins/solr-power/includes/class-solrpower-options.php: $options['s4wp_max_display_tags'] = 10 but it seems it doesn't change even after clearing cache

kshaner commented 5 years ago

@carl-alberto ,

I needed this as well and it worked by setting a large number to s4wp_max_display_tags. Setting it to -1 doesn't work as that also disables sorting by facet count. You could access it by filtering the get_option call:

add_filter( 'option_plugin_s4wp_settings', function( $options ) {
    return array_merge( $options, [ 's4wp_max_display_tags' => 10000 ] );
} );