Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Settings
- This topic has 31 replies, 2 voices, and was last updated 7 years, 1 month ago by
kondor.
-
AuthorPosts
-
March 26, 2019 at 10:23 am #21791
kondor
Participanthi
i purchased your plugin, and it is truly a good one!
a few questions please to help me set up the correct configuration:
i am using woocommerce, and added custom fields to products that will work as tags (search phrases).
same principle – i did with product categories.
i set the engine to search as follows:
source 1 >> in products only + defined the custom fields.
source 2 >> in product_cat only (no where to define custom field…)
the result i want:
return only exact search phrase that matches the custom field tags i addedthe result i get:
if product category has same name as search phrase – it returns it too…i do not want source 2 (product cat) to search anywhere else – only in the custom field i added…
how can it be done?
thanks
March 26, 2019 at 11:06 am #21794Ernest Marcinko
KeymasterHi,
Well, unfortunately there is no option to disable the search in category/term titles, it is hard coded. However, if you are okay with a direct code modification, it might still be possible.
To do that, follow this guide:
1. Before starting, make sure to have a full site back-up just in case
2. Open up the wp-content/plugins/ajax-search-pro/includes/classes/search/class-asp-search-terms.php file on your server via FTP
3. Replace it’s contents with this
4. Save the changesThis should do the trick, as the modified file does not contain the title query.
I think I can add an option in the upcoming release to disable search in the term titles, so this change wouldn’t be neccessary after that.
March 26, 2019 at 4:18 pm #21801kondor
ParticipantHi Ernest
Thanks for your prompt reply 🙂
ok, so now caetgories work correctly.
but now i have the following scenraio:
i added custom fields (to support search queries only) to products ( source 1 >> in products only + defined the custom fields ).to product A – i added custom field value “132”.
to product B – i added custom field value “G132”.
to product C – i added custom field value “G1321”.i defined “exact match only” >> but when i type “132” in ASP search field, it returns all of the above 3…
how can i define only super exact query to return as result – for example:
if i type “132” >> only product A should return
if i type “G132” >> only product B should return
if i type “G1321” >> only product C should returnTHANKS AGAIN!
March 27, 2019 at 10:20 am #21820Ernest Marcinko
KeymasterHi!
You are welcome!
Instead of exact matching, try this search logic configuration: https://i.imgur.com/6w0zGgN.png
I believe that is the closest possible solution without making changes to the files.March 27, 2019 at 11:46 am #21831kondor
ParticipantHi Ernest
thanks for your reply.
the settings you suggested returned no results at all, no matter what I type… 🙁
March 27, 2019 at 12:09 pm #21838Ernest Marcinko
KeymasterHi,
That is interesting. Are there multiple keywords in the fields, or only one? If there are multiple, then are the keywords separated by comma (,) or a simple space character within the field?
March 27, 2019 at 12:11 pm #21839kondor
Participantsome are singular key words (“desk”), and some are multiple keywords with space (“black desk”)
March 27, 2019 at 12:16 pm #21840Ernest Marcinko
KeymasterThose should work, according to the code, so I am not sure what is wrong.
Can you please add temporary FTP and back-end access? I woul like to make a few debug queries to see what exactly is going on. Thank you!
March 28, 2019 at 3:54 am #21859kondor
ParticipantYou cannot access this content.
March 28, 2019 at 4:54 pm #21881Ernest Marcinko
KeymasterThank you for the details.
Okay, so I have tried the search for “132” and it returned 3 results. I clicked on this one, and opened the product editor screen. However I cannot see the custom field editor there, that contains the keyword “132”. Unfortunately the page is in hebrew, so it is a bit difficult to me to find it 🙂
Where is this value defined on the product editor screen? Do I need to turn on something to be able to see the keywords input?
Let me know.March 28, 2019 at 5:32 pm #21883kondor
ParticipantYou cannot access this content.
March 29, 2019 at 9:56 am #21891Ernest Marcinko
KeymasterThank you very much, I think I understand what is the problem now. The field there is not actually a single text field, as it consists for a checkbox + input, and I think ACF stores them as a serialized object, so it contains additional string information.
Would it be an okay solution for you to use the additional seach tags field?
I have enabled that meta box for the products editor screen, and added the G1320 keyword to this product on the editor: https://i.imgur.com/1Fs6qFk.pngThat field is designed specifically for these search tags. I have tested on the search instance to search for ‘G1320’ and it returns the correct product now, only on full exact match on that field. Please let me know if this is acceptable solution for you.
If yes, then all you need to do is just add the keywords you need into that field.March 29, 2019 at 11:56 am #21907kondor
ParticipantHi Ernest,
thanks again – your support is truly amazing, so a good word must be said 🙂
I see what you mean, question is if it can also be enabled for product categories (the additional search tags) ?
(if yes – than i guess it is same principle i did with custom field – only better, since it is based / part of your plugin, so it will work perfectly)i will also need to know which search settings need to be applied so it will search ONLY in your additional search tags and return only 100% exact matches.
if possible, can you pls guide how to control search order (results from categories first if any, and products after)
again – thanks!
March 29, 2019 at 2:26 pm #21913Ernest Marcinko
KeymasterHi,
Unfortunately that is not available for product categories/taxonomies, at least not yet. For taxonomy terms I would recommend using a different custom field, a simple text input, or text area, not coupled with other fields.
The configuration can remain as it is, only make sure that the primary and secondary keyword logic is set as following: https://i.imgur.com/0jEnvGe.png
The mixed results ordering can be set under the ordering panel, in your case you want it like this: https://i.imgur.com/Q7YX6Tq.png
March 31, 2019 at 6:01 pm #21927kondor
ParticipantHi Ernest
ok, i got the idea of what you suggested and applied it.
1) for products i am using your additional tags
2) for product categories i changed custom field to repeater text filed.
exact words are searched now which is great!
only problems i have now are:
1) got products >> after adding tags and saving, the commas between each tag disappear and you cant know if it is a single word tag or 2 or 3 word tag (for example – if you insert the following tags: hello, john >> after saving you wont be able to know if the the tag is “hello john”, or if it is “hello”and “john”).
2) product categories:
a) still returning results that shouldnt return (seems like it is still searching in title too even after i removed the code you suggested)
b) i need product categories results (if any) before product results + if it is main category (parent) – it should be above child)
for example >> cat “fruits” is parent of cat” banana”both have tag “fruit”
i need “fruits” (parent) to show before “banana”) – currently i believe banana will show before fruits due to ABC ordering?
thanks!
-
AuthorPosts
- The topic ‘Settings’ is closed to new replies.