multisearch :label and image in results.

6 posts by 4 authors in: Forums > CMS Builder
Last Post: October 3, 2012   (RSS)

By rez - August 11, 2011 - edited: August 11, 2011

1. Is there a way to display an uploaded image in the results of a multisearch. Like showing this for product results:
Name
Description
thumbnail image

2. Well what else CAN we show in results? Just a titleField and summaryField? Name and description is working fine below. I'd like some more options / advancements / details. If that's our only to options, what else can go in them? Like is there a way to show a record in results that has a checkbox toggled?

3. Is there any way to search the label list of an item? In this case, it's an item with a category name/num list from another table. If a category was "12 inch latex balloons" and someone searched "balloon", all the balloon products would appear in the results that had their category set to 12 inch latex balloons. That would be great. Otherwise, if the :label doesnt work, i'm guessing it's just searching through the "num" of the category. :( Example that's not working:

$searchTables = array();
$searchTables['items'] = array(
'viewerUrl' => 'itemDetails.php',
'titleField' => 'name',
'summaryField' => 'description',
'searchFields' => array('name','description','category:label'),
);


thanks. I'm very glad i finally got this working. Hoping to get a little fancier. :)

Re: [rez] multisearch :label and image in results.

By Jason - August 11, 2011

Hi,

1) Since uploads are stored in a different table, multi-search doesn't have a way of returning uploaded records.

2) You can select up to 10 different fields from the section by using the "field" 1-10 option. For example, if you wanted to return the createdDate field, you can do this:

$searchTables = array();
$searchTables['items'] = array(
'viewerUrl' => 'itemDetails.php',
'titleField' => 'name',
'summaryField' => 'description',
'searchFields' => array('name','description','category:label'),
'field1' => 'createdDate',
);



3) List labels are not actually stored in the database, only the values, so there isn't a simple way of searching the labels.

If you want to do more complex searches, you may want to consider searching your sections 1 at a time, and then combining the results to output. This would probably give you a greater degree of flexability.

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/

Re: [zip222] multisearch :label and image in results.

By zip222 - January 13, 2012

nevermind...

echo $record['field1']

doh!

Re: [Jason] multisearch :label and image in results.

By Mikey - October 2, 2012

Jason or anyone who can help....

Is it possible to search the value of a check box = 1 using the multiSearch?

Here's an example of my code:

$searchTables['business'] = array(
'viewerUrl' => 'business_details.php',
'titleField' => 'name',
'summaryField' => 'content',
'searchFields' => array('name','content'),
'field1' => 'member = "1"',
);

Re: [zick] multisearch :label and image in results.

By Jason - October 3, 2012

Hi Zick,

Currently, multisearch will only allow you to search for a single value. If you need to only output records where a checkbox is checked, you could filter those out as part of your foreach loop.

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/