Reply To: Many problems with results


Ernest Marcinko


I think I have found the problems and probably solved them all. It was an unfortunate combination of incorrect configration and an unknown bug.

The main reason was that the ordering was set to the “postcode” custom field descending. Normally, this would work, however in your case there are items which have multiple custom fields by the same name, and the search code had a bug not limiting it to 1 when ordering. I've fixed the bug, but I also turned back the ordering to “relevance” as in your case the ordering by custom field won't do anything at all. Having multiple custom fields with the same name on the same post is not a problem, it turns out, you don't need to change that. 🙂

This solved almost all the issues you described except for one. When I tried to search “5766” there were no results. Then I figured out that the result expected is a “page” post type, but the search in pages is disabled. So I've enabled that as well.

I've also turned off the search in content and search in title, which will only cause problems here – as the content also contains a lot of IDs and numbers from Visual Composer.

Since you only need to search the codes, the final configuration is only to search the “postcodes” custom field within pages, posts and staff. This should work correctly now. Let me know if you find anything.

Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)