Custom Meta Fields - Multi criteria search

Custom meta tags can be used to allow searches based on specific criteria, similar to using categories but allowing for more customization. They are useful for web sites like e-commerce and real estate sites where searches will be based on specific criteria such as price, size, color, location or other defining features. By combining multiple search criteria it allows very specific searches to be made.

Custom meta field are available in V6 of Zoom. But not in earlier releases.

This tutorial references HTML pages that were developed for the Zoom fruit shop demo, a small web site based on a fruit shop selling different types of fruit and vegetables. There are two main steps to adding custom meta fields. The first is adding additional meta data to each HTML page in question, the second is configuring Zoom to use those new meta fields before indexing the site.

The image below show the custom meta tags added for the "Lettuce" item of the demo.

Custom meta field example

"ZOOMIMAGE" is the thumbnail image that is displayed in the search results for an item.
"PRICE", "TYPE", "PRICEMETHOD", "ORIGIN", "ORGANIC" and "AVAILABILITY" are the custom meta tags we have entered for each of the HTML pages in the demo.

Meta fields can have any name. But the name must be used consistently throughout your web site. The content information is the value of this field on this page. Note that if a field has multiple values you can create a multi-select field and have the same field apear multiple times in the meta data (as is the case above with the AVAILABILITY field).

In the Zoom Indexer you will then need to go to the "Custom meta fields" option on the Configure tab. Use the Add button to create a new entry for each of the meta fields you have added to your pages. For each entry you will need to add the matching name of the meta tag, choose a type, enter how the field will appear in search results and on the search form and choose a method for matching results where required. The Zoom Indexer help file section "Custom meta search fields" details the different types and search methods that are available to use for each meta tag.

The images below detail the creation of the PRICE meta tag and the extra configuration option available for Money where you can choose the currency symbol.

Adding a custom meta field Extra options

The image below shows the custom meta fields after they have been entered into the indexer for the fruit shop demo; TYPE, PRICE, PRICEMETHOD, ORIGIN, ORGANIC and AVAILABILITY.

Adding meta fields in Zoom Indexer

After entering the meta tags the site needs to be re-indexed. Zoom will then generate the necessary search template with corresponding entry fields for each of the meta tags added. You can also design your own search form, using the default one generated by zoom as a starting point. Searches based on each of the meta fields can then be done from the search form.

Search form

The search results returned also display the contents of the the meta fields. Each has a "result_metaname_METANAME" and "result_metavalue_METANAME" CSS class name, with METANAME replaced with the meta tag name as previously entered in the Zoom Indexer (eg "result_metavalue_PRICE"). CSS can then be used to change the format of each meta result or hide them, for the demo we have chosen to show only the PRICE meta tag in the search results and hide the rest.

As an example search using the Zoom fruit shop advanced search, entering 2.5 in the "Maximum price" field and clicking submit will display results where the PRICE meta field has a value of 2.5 or less as we selected the "less than or equal too" option when entering the meta field into the Zoom Indexer.

Below is a sample of the results that were returned from the search. We could refine this even more by selecting "Kilo" from the "Price per" field so only results that are less than $2.50 per kilo were returned.

Search results

Note for PDF files: If you are trying to search PDF files (or other binary file types, like Word and Excel) with custom meta fields, then it is not possible to add meta data directly to the PDF file. But you can instead use .desc files. See the users guide for additional details about .desc files.

 

Return to the Zoom Search Engine Support page.