Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Cannot display results by relevance
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 6 months ago.
- AuthorPosts
- September 3, 2021 at 7:34 pm #34528
Hello,
I cannot make the plugin shows the results in relevance order.
For example, if you type “dinero el verdugo” (wich has an entry with this exact words) it shows in the first place an entry only with the word: “dinero”, and displays the most exact entry in second or third place (please see attach).
Is it possible to adjust this?
Thank you very much and congratulations for this awesome plugin.
Attachments:
You must be logged in to view attached files.September 6, 2021 at 8:51 am #34544Hi,
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.
Best,
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.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
September 6, 2021 at 3:56 pm #34557Hello Ernest, it is very clear, thank you for your answer.
In the near future we will work mostly with non poems texts, so no need to bother you about this matter.
Best wishes
September 7, 2021 at 12:10 pm #34567You are very welcome, let me know if you need any help.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.