Returning more than a minimum number of results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Returning more than a minimum number of results

This topic contains 5 replies, has 2 voices, and was last updated by

5 years, 4 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #8943


    If I have a retail store with 100 items, is there any way to coax the Ajax Search Pro plug-in to behave more as a re-ranking system for each of the 100 items (displaying the top 10, based on relevance), instead of a filter (only displaying only instances that match the keyword)?

    I would like the search results to always return a minimum of 10 results. For instance, if someone searches for “tigers” and I don’t have any posts on tigers, but I do have recent posts on lions, cats, and cheetahs, what is the best way for the results to output something other than a blank page? And if I only have 2 posts on tigers, could I pad the results page with 8 other recent posts by including a hidden, low-priority “OR all posts” tag for all queries?

    I expect that this would be a highly-used feature. If a user on a retail site searches for shoes, but the retailer does not have any, that retailer would surely prefer to show them socks, or shirts, or the latest additions to the store–anything other than an empty page. Moreover, even if they sell one variety of shoe, there is a lot of value in showing other products. Same issue with real estate websites.



    I really like this idea. I’ve never actually thought of it, but this would be an amazing feature. I’m putting this to the upcoming features list on my feature tracker.

    Unfortunately I can’t suggest a quick modification to make this possible with the current release. I’ve looked into the files to maybe find a possible way, but it requires too many changes.

    Expect to see this feature in one of the upcoming releases in the next few weeks though 🙂

    Ernest Marcinko

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



    Thanks, Ernest!

    In case it helps, here is one thought on how to potentially implement this. (This is offered very humbly as a brainstorm and you should probably talk to a search expert.)

    I think right now when you create an index table, only the posts with a keyword match are captured in the results for that keyword. (This is a first-order result.) However, if at least one first-order result is found, you can use the keywords in the found result(s) to look for matches in the remaining unindexed posts. (These are second-order results.) The algorithm should be recursive until all posts are indexed in a specific order for each keyword.

    Example: If I search for lion, and there is only one post for lion, that post is added to the top of the lion keyword index. But if the post for lion also contains the keywords “cat” and “animal”, then the post for tiger, which also contains the words “cat” and “animal” and “zoo”, should be added second to the lion keyword index. If there is a post for a bear, which only has the word “animal” in it, that could be added third to the lion keyword index. Then search the remaining posts for “zoo” (a third-order search), etc.

    This would be useful because if I only have one or two post results, the algorithm will highly rank those other posts which have similar tagging to the original results.

    If, after that process, some posts remain unindexed, they can be added to the table by default (such as by most recent post), but every post should have a ranking for every keyword in the index. If a user entered a word that is not found in any post, then I think you should just say “no results found” but leave the default ranked results in place.

    Separately, (and this is probably a separate feature and way beyond this scope here,) it would be awesome if someday Ajax Search Pro also let you weight the ranking of results based on what frequency of search, and frequency of click-through, rather than just by post date. When people come to my site, I would like to also show some of the most searched-for items in the default result, or the most clicked-on items over the last 3 months, as well as some of the more recent items.

    Highest regards,


    Great idea, and great suggestions I must say. You really put lot of effort to this, and you even offer a possible solution – that is something I rarely see in the support forums 🙂

    I really like your idea finding related items, it would be actually very useful. One huge issue I’m always facing is, that I always have to consider what an average users server architecture looks like, and tailor the plugin balancing the performance and the relevance of results to that architecture.
    It’s fun in a way, that I have too come up with interesting ways of getting around complicated queries and solutions to maintain as much performance as possible. One of these solutions is the index table architecture, which is similar to what the relevanssi plugin uses. It generates lots of lines (I’ve seen installations with over million records in the index table), yet the performance is linear, and very effective to query, if it’s done right. It’s one of the things I learned about databases – that the amount of data is less important than the proper architecture and proper ways of querying that data in terms of performance.
    Anyways, I can see a possible solution to achieve something similar as you described using the index table, as it holds all the data required: keyword occurence data, post IDs, language information etc..
    This is going to happen sooner or later, I’ve already noted as a feature in a future release, everything seems to be given to implement it in some way, without hurting the performance.

    Ordering by clickthrough: I’m actually planning to implement this, alongside with the statistics re-work. It should be available in the upcoming (major) release.

    Ernest Marcinko

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



    Hi Ernest,

    Back in June you indicated that you were adding the “re-ranking results rather than filtering results”/”always show a minimum number of results” feature to the Ajax Search Pro planned feature tracker and that it might be included in an upcoming release. (See thread above.) I realize that you are working on many features but is that still on the development horizon?

    Best regards,



    Yes, it’s not forgotten, don’t worry. In fact I have already sketched and tested a few possible solutions. The final and most optimal solution will be a “synonyms” feature. There will be an additional menu where you can add words and synonyms to them. You will be able to choose which search instances it affects and whether is should apply if the results count is lower as defined, or apply all the times (adding up relevance).

    This I believe is the simplest from the customers point of view – and the back-end solution is optimal for the performance as well.

    Ernest Marcinko

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

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.