Skip to Content Skip to Menu

search over multiple fields

  • startup
  • startup
  • OFFLINE
  • Posts: 113
  • Thanks: 7
  • Karma: 1
  • Add-ons
9 years 6 months ago #262761 by startup
search over multiple fields was created by startup
Hello,

I am looking to realize a search over multiple CB fields containing text. Let's say user profiles have three fields cb_field1, cb_field2 and cb_field3 containing text. I'd like to do so that only one field is shown in the search but that it would search the contents of all three.

My idea was to make a 4th field cb_keyword of type text field, concatenate the other three via substitution in its description as [cb_field1] [cb_field2] [cb_field3] and set cb_keyword as shown in search. While the cb_keyword does show in search, the query itself returns zero results always. I assume this is because substitution does not work when the field's type is 'text field'?

I then tried to make cb_keyword of type 'custom HTML'. In that case, the substitution works fine which I can see by showing the cb_keyword field on the profile (for testing). However, in the search, I only get the fields title displayed, but not a box where I could enter text to search. So that did not work either.

Is there a variation to any of the above I could try to make it work?

Or perhaps another approach altogether? for example using CB Query Field? Would a field of that type be searchable by any chance?

Thank you for your advise.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 6 months ago #262796 by krileon
Replied by krileon on topic search over multiple fields
The only way to do that is to use CB Search Bot and Joomlas search module. We currently don't have a way to search multiple fields from a userlist using a single input. We probably won't have such a feature until we get fieldtypes refactored as their code has yet to be fully upgraded. Once we refactor it their search query usage should be more usable and doing something like this should be more functional. CB Search Bot uses some workarounds to get around such missing feature, but it's not as good as it should be.


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum