Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search results page, limited returns, recurring items
- This topic has 6 replies, 2 voices, and was last updated 7 years, 11 months ago by
Ernest Marcinko.
-
AuthorPosts
-
June 27, 2018 at 7:41 am #18457
mitchcan
ParticipantStill working through some options on Pro. I previously had lite, so the learning curve is somewhat shorter.
I am trying to get a better search results page, and have several related questions.
Here is the detail.
I enter a search term “apples” the results ‘box’ shows several results as expected, and at the bottom it says 165 more. I click on that and go to the search results page.
The page loads the first 15 items.
I scroll through those, and click the Load More button. It loads 15 more. Twice more, and that’s it. The box said 165 more, but only a total of 60 loaded. That is question 1, where are the rest of the items?
Issue two is the redundant search returns. One item that shows in the search is an event that has ten occurrences. How do I eliminate occurrences 2 through 10 or a recurring event from displaying in search returns? I just want the search to return one instance, not all 10.
The two search results pages referenced earlier had 25 events, 25 posts, 0 products and 10 places. I know for a fact there are actually over 100 Places that should return in this search. Why did it stop at 10 places, and 60 total?
I have Options > Limits set at ‘100’ for the results page. I also have ‘distribute equally’; enabled. (if I disable that, I get 298 ‘more results’ – but I never return (display) enough items on the results page to get past the first post type ‘events’). Does this need to be adjusted somehow?
Really looking forward to working with this plugin. Thanks
June 27, 2018 at 5:24 pm #18470Ernest Marcinko
KeymasterHi,
The more results counter is based on an estimation, as the fully query is not executed for performance purposes, and there is a chance that the final number might be lower as the one displayed there.
On the General Options -> Limits page, make sure that the post type limit for the results page is also increased accordingly: https://i.imgur.com/3LzwOB9.png
This affects the number of results on the results page, regardless how much the ‘show more’ button shows, it will be limited to this number. The ‘distribute equally’ option might also affect this negatively with high numbers, it is a bit hard to predict, as it must run separate queries for each post type, then keep track of results to prevent duplicate objects.Can you please give me an example query I can test for the duplicate events? I tried a few search phrases, but I can’t see any duplicates yet.
I see the theme has a ‘load more’ results feature on the results page. It is possible that it might be limited to certain number of pages only, although I cannot confirm that.
June 27, 2018 at 7:42 pm #18474mitchcan
ParticipantOK, I will just CSS out the more # quantity as it is potentially confusing. I will also make some tweaks and test again to see what happens.
I had that number in the image set at 100. But again it stopped at 60 results. I’ll adjust and retest.
On the URL I provided, do a search for the word ‘camas’ – this will give you an example of the redundant items.
I’ll check on the ‘load more’ limitations in the theme, I was not aware of any, but I’ll double check.
Thanks.
June 27, 2018 at 10:30 pm #18479mitchcan
ParticipantI adjusted that page results number to 300 and it worked to display all items as expected. Not sure why that needs to be that high, maybe related to the auto calc of items of each post type (setting to equal out was enabled). Tested both date filter on and off and worked fine at 300. It also worked fine at 200 for items I knew would have fewer results, fwiw.
Since I expect to use a date exclude function for the main search, having that high of a number likely should not matter.
The redundancy issue is still a real problem though, so if there is a way to only pull that first instance of an item that would solve many issues.
Thank you.
June 29, 2018 at 4:09 pm #18516Ernest Marcinko
KeymasterHi,
Regarding the redundancy: the problem there is that those events are actually not the same event, but separate ones, or at least the post IDs are different, which makes any post type object unique.
However, it is possible to remove these ‘duplicates’ with a custom code. I have constrcuted a small custom snippet, that will check for duplicate titles and remove them before returning the results. Please note, that this may cause incorrect results counts in some cases, because of the item removals from the results list.
Try adding this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!
I hope this helps!
June 29, 2018 at 8:18 pm #18529mitchcan
ParticipantYes, the events plugin creates new post-ids for the same (recurring) events. I don’t like, but it is what it is.
This workaround is excellent. Tested this on staging, works well. Will move it to live site to test this weekend.
Thanks so much, fantastic support!
June 29, 2018 at 9:01 pm #18533Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- The topic ‘Search results page, limited returns, recurring items’ is closed to new replies.