Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Results grouping
This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 5 months ago.
- AuthorPosts
- March 18, 2022 at 11:38 am #37209
Hi, I’d like to ask about grouping under Advanced Options. I selected grouping results by Categories/Terms and chose only the parent categories. I notices that when a post is in a child category, they won’t show up under the parent category group but show under Other results. Is this normal? I’d like them to show under the group of the parent category.
March 18, 2022 at 3:21 pm #37216Hi,
Is the post assigned to the child category only, and not to the parent? In that case the post does not actually belong to the parent category, therefore WordPress will return a false match, when checking if there is a connection between them.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 21, 2022 at 8:07 am #37223Yes they are assigned to the child category only.
But this will be different from querying post using WP_Query (e.g. in category archive) where selecting a parent category will also get all the child category’s posts even if they are not assigned to the parent category?
March 21, 2022 at 3:02 pm #37233In this case WP_Query can not be used, as we are not querying the objects by terms, but the terms by the objects. So wp_get_object_terms or get_the_terms are the only options, and those will not return the unchecked parent categories for the objects.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
March 22, 2022 at 10:44 am #37248May I ask if enabling grouping will make searching slower?
March 22, 2022 at 11:01 am #37251It can, as it has to request the terms for each post – but it is probably not noticable, unless you are planning to display thousands of results all at once.
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.