• Resolved wannabequokka

    (@wannabequokka)


    As the title states I have a problem that ElasticPress does not search for substrings within ACFs.

    I am currently using ElasticSearch version 7.10.1 and ElasticPress version 4.7.0.

    For example if I’m searching for MySubstring it will only find results where the whole word MySubstring is matched but not SomethingAtTheStartMySubstringMySubstringSomethingAtTheEnd, SomethingAtTheStartMySubstringSomethingAtTheEnd.

    This post suggests that a fuzzy search is executed by default on meta fields when using an approach like this

    new WP_Query( array(
        's'             => 'meta search phrase',
        'search_fields' => array(
            'post_title',
            'post_content',
            'post_excerpt',
            'meta' => array( 'meta_key_1', 'meta_key_2' ),
        ),
    ) );

    As the docs state:

    Applies the current search to post meta.
    The following will fuzzy search across post_title, post_excerpt, post_content, and post meta keys meta_key_1 and meta_key_2:

    The search itself is working for whole words, but as I said not for substrings.

    I’ve already tried to search for a solution but couldn’t find any solution.

    I am not able to use a LIKE query like this post suggests, because I’m using repeater fields with a non deterministic number of entries like repeaterName_1_fieldName, repeaterName_2_fieldName, repeaterName_3_fieldName, … , repeaterName_N_fieldName

    Thank you guys in advance.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘ElasticPress does not search for substrings’ is closed to new replies.