• Resolved jmslbam

    (@jmslbam)


    Hi all, thank you for the plugin. I’m researching the possiblity to implement typesearch in my prototyping to migrate away from FacetWP to Typesense. I have it up-and-running with facets and taxnomies and all. The only thing I can’t seem to manage / change is by checking 2 checkboxes in a facet that the POST does an AND instead of an OR on the taxonomy search query.

    This is from the Typesense docs https://typesense.org/docs/27.1/api/search.html#filter-parameters

    • genres:=[Rock, Pop] will return documents where the genres array field contains Rock OR Pop.
    • genres:=Rock && genres:=Acoustic will return documents where the genres array field contains both Rock AND Acoustic.

    Because we would like to make the result-set narrower, instead of larger.

    Looking forward to building on-top of Typesense.

    Kind regards!

    Jaime Martinez

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author CodeManas

    (@codemanas)

    Hello @jmslbam ,

    Thank you for using our plugin and for the query above.

    To make the facet search with AND instead of OR, you would have to change the operator config like this:

    add_filter( 'cm_typesense_search_facet_settings', 'your_slug_custom_facet_settings' );
    function your_slug_custom_facet_settings( $settings ) {
    $settings['operator'] = 'and';
    return $settings;
    }

    Regards,

    Code Manas

    Thread Starter jmslbam

    (@jmslbam)

    Sorry for the belated response and thank you for your quick reply!

    Great that it’s already backed-in!

    Kind regards,

    Jaime!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.