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?
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 …
WpGrid’s response:
“About the comma/dot, this only depends on the Relevanssi engine and not WP Grid Builder.” … 🙁
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?
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 2 years, 5 months ago by
sergio79.
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.
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.”
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…
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”.