[#5156] CB 2.0.7 Discrepancies in backend and frontend search output

9 years 4 weeks ago - 9 years 3 weeks ago #259886 by Camino
I have a field that allows users to choose between one or more of 99 two digit numbers (It is the first two digits of Postal codes where they are willing to receive job offers for).

Searching in frontend for users who have marked 23 and 80 the output for "include any of" is 1269 users. Going to backend the search for 23,80 using "is one of (,-separated values)" the search output is 287 profiles. After investigating it, in this backend search only those profiles are displayed that either have selected 23 or 80. Profiles that have both or for instance 24 or other values are not displayed.

1) Is it possible that the comma separated search is not working properly?
2) I suggest to also offer the "include any of" search again like in prior CB versions as it worked like a charm. Another option could be a REGEXP search operator.

Please kindly advise.

Please Log in to join the conversation.

9 years 3 weeks ago #259976 by krileon
Use the "Contains" or "Does not contain" operator to match a value in a multiselect. The comma separated usage assumes the value you're searching for is exact. For example if you supply 23,80 then it's looking for users with the field value being 23 or 80 exactly.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

9 years 3 weeks ago #259989 by Camino
The multi select field contains 99 fields with values 1 to 99. The backend search does not allow an OR search combination of two values, either with "contains" nor with the comma separated values search. I assume it is a bug. Can you reproduce it?

J 3.4.0 / CB 2.0.7

Please Log in to join the conversation.

9 years 3 weeks ago #259991 by krileon
The "Contains" and "Does not contain" operators are just database LIKE statements. Example result of using Contains as follows.

( a.`cb_dropdownmultiple` LIKE '%Value 1%' )

This is working as intended and includes the needed wildcards. The advanced search is not OR, but always AND. You'd need to do 2 different searches. Eventually we'll extend the advanced searching to support OR usage for each further usability (once our XML Query API can better handle it), but for now it's always AND.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

9 years 3 weeks ago #259992 by Camino
But how can I do an OR search in multiselect fields then in backend now or is it not possible for now?

My solution:
1) An OR search is possible in frontend search, so you can enable it in backend (unless you are using totally different code)
2) With multiple filters currently the search is AND. It could be possible to choose whether the additional filter is OR or AND
3) Implement an REGEXP search in backend (it is used in CB auto actions already)

Please kindly advise.

Please Log in to join the conversation.

9 years 3 weeks ago #260056 by krileon

But how can I do an OR search in multiselect fields then in backend now or is it not possible for now?

It's not possible as explained above. We don't have OR usage yet.

1) An OR search is possible in frontend search, so you can enable it in backend (unless you are using totally different code)

Frontend and Backend are 100% different code. We don't use the XML library on frontend yet for reasons such as this (we're missing a few things).

2) With multiple filters currently the search is AND. It could be possible to choose whether the additional filter is OR or AND

That's the idea, but again we don't have OR yet.

3) Implement an REGEXP search in backend (it is used in CB auto actions already)

That maybe a possibility, but the issue is most users have no idea how to write REGEX and that's when it's PHP REGEX where the markup is quite easier to use. SQL REGEX markup is quite a bit more advanced and very widely varies in usage depending the SQL version. It'd be extremely easy for users to cause fatal errors with this and would lock them out of user management. At any rate I'll take a look into adding it and capturing the SQL try/catch to prevent user management from being locked.

forge.joomlapolis.com/issues/5156


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.343 seconds

Facebook Twitter LinkedIn