• Resolved sergio79

    (@sergio79)


    Good morning Mikko,

    I wanted to report this to you: I use your plugin through both classic wordpress search and through “Relevanssi Live Ajax Search” and everything I set in the searches (especially special character replacement functions) works correctly. Then I also set “Relevanssi” as a search engine for a text field created via Facet of Wp Grid Build (because it supports Relevansi), and for example, when I search for “3.50” (with relevanssi_remove_punctuation function), no results appear … if on the same page I search via “Relevanssi Live Ajax Search” I get results … what can it be?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Mikko Saari

    (@msaari)

    If the results from the WP Grid Builder are not consistent with other Relevanssi results, that would suggest WP Grid Builder is not using Relevanssi. I don’t know what it does or how it works, so I can’t comment in much more detail. Perhaps WP Grid Builder support can help you?

    Thread Starter sergio79

    (@sergio79)

    Okay I’ll try to write to them … it’s weird though because I’m sure WpGrid uses Relevanssi for search because it finds me articles indexed by SKU (which WP search would not do). I also noticed that besides not finding these results with special characters (handled with relevanssi_remove_punctuation), all the results have cmq a different order, compared to what “Relevanssi Live Ajax Search” finds …

    Thread Starter sergio79

    (@sergio79)

    WpGrid’s response:
    “About the comma/dot, this only depends on the Relevanssi engine and not WP Grid Builder.” … ??

    Plugin Author Mikko Saari

    (@msaari)

    Hmm, that sounds odd. The filter functions should work, no matter what the context is; especially as some of those are indexing filters. But if, for some reason, all filters don’t fire in all contexts… can you please show me the filters you are using?

    Thread Starter sergio79

    (@sergio79)

    Sure:

    add_filter('relevanssi_remove_punctuation', 'rlv_keep_brackets_1', 9);
    
    function rlv_keep_brackets_1($a) {
    ? ? ? ? $a = str_replace( '/', 'slashSubst', $a );
    ? ? ? ? $a = str_replace( '-', 'minusSubst', $a );
    ? ? ? ? $a = str_replace( ',', 'commaSubst', $a );
    ? ? ? ? return $a;
    }
    
    add_filter('relevanssi_remove_punctuation', 'rlv_keep_brackets_2', 11);
    
    function rlv_keep_brackets_2($a) {
    ? ? ? ? $a = str_replace('slashSubst', '/', $a);
    ? ? ? ? $a = str_replace('minusSubst', '-', $a);
    ? ? ? ? $a = str_replace('commaSubst', ',', $a);
    ? ? ? ? return $a;
    }
    • This reply was modified 1 year, 2 months ago by sergio79.
    Plugin Author Mikko Saari

    (@msaari)

    I see no problem with these. So I have to say –?no idea. I recommend trying to debug what is actually happening in the WP Grid Builder search compared to the Live Ajax Search; obviously, there’s some difference between those two as the results are different.

    Thread Starter sergio79

    (@sergio79)

    This is the response from their technical support… it is still not clear how with “Relevanssi Live Ajax Search” everything works normally, and with WP Grid it doesn’t…

    “This behavior depends on Relevanssi settings, such as the minimum word length and decimal separators.
    When you set Relevanssi as the search engine in the facet settings, it is Relevanssi that queries posts, and the search strings depend on Relevanssi settings.”

    Thread Starter sergio79

    (@sergio79)

    In fact it depended on the number of minimum characters, I had set it to 3 … and my search was “3.00”, thinking they were 4, but with the substitution of the comma character, evidently they are considered 3. I lowered it to 2, and now works. Strange though that “Relevanssi Live Ajax Search” ignored the minimum number of characters I had set in Relevanssi…

    Plugin Author Mikko Saari

    (@msaari)

    Yes, the word length is checked after the punctuation is removed. You keep the commas, so “3,00” would be four characters, but if the periods are removed “3.00” becomes “300”.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Strange problem with WP Grid Builder’ is closed to new replies.