Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Cannot display results by relevance › Reply To: Cannot display results by relevance
Hi,
Thank you for the details, it helps a lot.
It took me a while to figure this out why, as it should have returned the results in the expected order. It turns out, the field containing that text, has many line breaks – as most of them are poems. The problem is, that the text “dinero el verdugo” is actually stored as:
...dinero el
verdugo..
On database level the phrase “dinero el verdugo” will not match that in any case exactly, as there is a line break character after the word “el”. In the results list it is displayed “correctly”, as the field is already processed (line breaks removed etc..). However it was not an exact match on the server side.
I thought a lot about a possible resolution to this, but the only way to do it is to have a copy of the desired text without the actual line breaks – and then search that, there is no other way around it. Let me know if that is something you are okay with.
I will put together a code snippet, which makes a copy of the 1st chapter field, and clears it, then stores it in a different field – it will execute when a new post is added or an existing saved.