Keyword search on 'label' values

3 posts by 2 authors in: Forums > CMS Builder
Last Post: October 30, 2011   (RSS)

Hey,

I have a field "model" which is a pulldown, linked to table "manufacturers", with 'num' as the value and 'title' as the label.

If is use a 'model_keyword' search, it's searching the 'num' values of the field. Makes sense.

However, I want to be able to apply the 'model_keyword' search to the 'title' (label) value of the record.

Is that at all possible (easily & quickly), without running lookups for the searched keyword in the 'manufacturers' table and returning nums?

Thanks!
Rob

Re: [rjbathgate] Keyword search on 'label' values

By Jason - October 28, 2011

Hi Rob,

model:label is a pseudo field that is only attached to the record after it is returned by getRecords(). The "num" is the only value actually stored in the database. So your best option would be to do the keyword search on manufacturers first and use the resulting list of nums to search against your main table.

The only other options I can think of is to return all records regardless of model and then skip records that where the model:label doesn't match the search query.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/