MSP01 Posted November 29, 2021 Share Posted November 29, 2021 So I'm trying two different selector values, both values exist on page titles that are being searched. CASE 1 title*=test_7.50 CASE 2 title*=test_7.00 CASE 1 will return all pages with test_7.50 in the title. However CASE 2 will return zero pages, even though there are plenty with that exact value in the title. Aside from 5 being replaced by 0, the titles and the search phrases are identical. If I change the dot to comma, both values return pages. I was wrong on this, comma doesn't actually work any better. Why does CASE 2 not work? I tried to do some googling, but found nothing on this. I'm assuming the search being a "phrase" and not a "word" search is part of the issue. Link to comment Share on other sites More sharing options...
horst Posted November 29, 2021 Share Posted November 29, 2021 Have you also tried it with the $sanitizer->selectorValue()? Does it behave the same or different? Link to comment Share on other sites More sharing options...
MSP01 Posted November 29, 2021 Author Share Posted November 29, 2021 Yeah, the selector value is sanitized. I actually made a small mistake in my first post. The actual problem is the trailing zero. These don't work CASE 1 title*=test_7.50 CASE 2 title*=test_7.00 This works CASE 3 title*=test_7.5 So basically if you search with *= and the value ends with zero, you run into problems. Using ~= works fine, but this example is simplified and I'm actually searching for a phrase. Link to comment Share on other sites More sharing options...
horst Posted November 29, 2021 Share Posted November 29, 2021 It looks like the numeric chars aren't seen as text but as number and gets cleaned up like trailing zeros in decimal sector have no meaning. So I bet if you have something like 7.50000 it comes out as 7.5 but 7.50001 will come out as 7.50001. I'm not sure if this sort of clean up (sanitizing) is done by PW or by MySQL. ?? Link to comment Share on other sites More sharing options...
MSP01 Posted December 1, 2021 Author Share Posted December 1, 2021 That's a good question. Well I managed to solve it by using combination of different selectors for different cases. It just had me stumped for a while because I wasn't sure what was going on. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now