Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Unexpected behaviour when filtering
- This topic has 11 replies, 2 voices, and was last updated 4 years, 4 months ago by
Ernest Marcinko.
-
AuthorPosts
-
January 2, 2022 at 4:31 pm #36153
Preet
ParticipantHi there and happy new year!
I am really struggling to implement settings.
For a custom taxonomy, “Restrictions” made by Toolset, a product has a restriction such as “vegan” or “gluten-free” only if it is certified as such. I want only certified products to be returned if these filters are used. So I have set:
Frontend Search Settings > Advanced > Show posts/CPM with empty (missing) taxonomy terms? To Off
I have set all terms to unchecked by default. And set Ignore checkbox filters that have nothing selected? To On.My understanding of this is that the checkboxes will be ignored until at least one is checked, and then only those results will be returned.
However, with Show posts/CPM with empty (missing) taxonomy terms? Off, no products are returned at all. This is the setup of the search demo here https://xyz.shop/search-demo/
You can use probiotics as a search term and gluten-free as a restriction. Here is an example of a product that should be returned https://xyz.shop/product/proven-probiotics-fit-for-school/
Here is a Loom describin it [xyz]
I am using the Index table, and have products-Restrictions selected for indexing.
Can you think what could be my problem?
Many thanks,
-
This topic was modified 4 years, 5 months ago by
Preet. Reason: privacy
January 3, 2022 at 1:24 pm #36157Ernest Marcinko
KeymasterHi Christopher,
We wish you a happy new year too!
You are probably looking to change this option: https://i.imgur.com/yHbWd4H.png
With the default setup, the unchecked checkboxes are treated as “exclude” – so if the item is within more than one category, and only one of them is checked, it will be excluded.January 3, 2022 at 1:50 pm #36158Preet
ParticipantHi Ernest,
Thank you for that. Unfortunately for these restrictions it does need to be an AND filter.
If the searcher needs to be both Gluten-free AND Dairy-free, we don’t want to return results that may only be one of them. That is what I thought I had allowed for.
Best wishes
January 3, 2022 at 2:20 pm #36160Ernest Marcinko
KeymasterIn that case use the third logic: https://i.imgur.com/Udguphf.png
That is basically an “AND” logic, but a bit more strict as only the exact combinations are allowed.January 3, 2022 at 6:00 pm #36162Preet
ParticipantAha! Brilliant! Thank you. That is much better. A game changer!
The next issue is that I am having trouble searching for strings with one letter words. eg. Vitamin A. I have set primary keyword logic to AND with exact matches, and min word length to 1, but a product with “Vitamin A” in the title, content and category is subordinate to other products that don’t have it in the title or category, and lots of other categories are returned above it.
Another niggle is that products with none of the restrictions checked (eg books) are still returned. Is it possible to stop that?
Thank you.
January 4, 2022 at 12:19 pm #36166Ernest Marcinko
KeymasterYou are welcome!
The results returned when searching “vitamin a” match, because both the “vitamin” and the “a” keyword matches within the contents of those results.
If you want to be more strict, then you can either turn off the matches from within the contents, or use exact matching.January 4, 2022 at 12:57 pm #36169Preet
ParticipantHi there,
Thank you, OK, there seem to be quite a lot of trade-offs, like intense strictness and losing the index table which may not be worth it for this which is probably the hardest search string. The worst edge case.
Switching to some issues I’m having with the Frontend Search Settings…
Multiselect with search does not seem to respect the Filter boxes max height. Is that right?Thanks.
January 4, 2022 at 1:19 pm #36171Ernest Marcinko
KeymasterYes, that is intentional for better layout.
You can however easily force it via some custom CSS:
fieldset[class^=asp_filter]>div { max-height: 200px; overflow: auto; }January 4, 2022 at 3:28 pm #36173Preet
ParticipantOdd, this doesn’t seem to work. Other minor issues with the settings dropdown formatting include:
1. the placeholder text for the multi box is lighter than the others
2. When displayed in columns on mobile, it spills off the left hand side of the screen. Can it be made to drop down from the far right edge of the magnifying glass icon, instead of the settings dropdown?Thanks
January 5, 2022 at 2:00 pm #36182Ernest Marcinko
KeymasterHi,
Make sure to clear the complete site cache for the custom CSS to take effect.
1. It follows the default browser colors. Try:
input[class*=select2]::placeholder { color: #1f1f1f; font-family: Roboto,Helvetica; font-size: 14px; }2. I’m afraid no, but you can rather choose a block layout instead of the hover, so the items follow the document flow, instead of hovering over the contents.
January 10, 2022 at 9:41 pm #36223Preet
ParticipantHi there,
Thank you. I don’t think it is caching, as I am generally able to get CSS to update immediately, and have tried clearing all the caches.
It’s also quite odd that when I choose Block, the Settings drop-down background color changes to transparent, adopting the colour of the background of the Elementor block that it is in.
input[class*=select2]::placeholder worked well, and I specified my custom font (Myriad-pro), as I have specified it everywhere. But still the other drop downs in there are showing Helvetica. I have no idea where they are getting that from. Do you have any idea about that? It’s pretty much there now, but it would be good to iron out that niggle.
January 11, 2022 at 12:23 pm #36239Ernest Marcinko
KeymasterHi,
It looks like the inherent font is overrriding some of the items from Elementor, at least that is what I am seeing in the console.
Maybe try forcing all of the fonts within the search to myriad pro:.asp_w, .asp_w *, span.asp_select2-container ul li { font-family: 'Myriad-Pro', myriad-pro, sans-serif !important; }That should take care of everything.
-
This topic was modified 4 years, 5 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.