Alternative Metadata Values
Funnelback supports the storing of multiple alternative values within a single metadata string. When comparing or presenting values from a metadata string, a particular value can be selected by specifying a key, with fallback to a default value if the key is not present.
Note: If a metadata field containing multiple alternative values is accessed without using the special options in the table below, the whole string will be used. To use the default value you must use the special options with a non-existent key, such as 'default'.
Documents containing alternative metadata values can publish this metadata in the following form:
<meta name="FIELD" content="DEFAULT_VALUE;NUM_EXCEPTIONS;(KEY;VALUE)...(KEY;VALUE)" />
- Keys may contain spaces and commas but not semicolons, double-quotes or parentheses.
- Values may include semicolons, double-quotes and parentheses but only within double-quotes. To include a double-quote within a quoted part of a value, use double double-quotes. If a value is just double-quote, you will need to represent it using four consecutive double-quotes.
- Semicolons are used to separate keys and values and also to terminate the default value and number of fields (currently ignored).
- Values do not have to be numeric.
- A maximum of ten fields may be made selectable.
- Only one selector can be specified per field. In an e-commerce example, the price of Vegemite could be made to depend either on the size of the jar or on the store, but not both.
Querying Selectable Metadata
The selectable metadata mechanism can be controlled via CGI parameters:
|selector_class||string||specifies the key to use when accessing the given metadata class|
|slt_class||float||Performs a "Less than" operation on metadata class, accessed by the key|
|sle_class||float||Performs a "Less than or equals" operation on metadata class, accessed by the key|
|sgt_class||float||Performs a "Greater than" operation on metadata class, accessed by the key|
|sge_class||float||Performs a "Greater than or equals" operation on metadata class, accessed by the key|
|seq_class||float||Performs an "Equals" operation on metadata class, accessed by the key|
Example Search Strings
Return items whose price in 'mystore' is no greater than 4.20:
Display search results with French versions of the 'category' and 'description' metadata:
Example 1: e-commerce
A large on-line retailer sells the same item for different prices, depending upon the location of the customer's nearest store. Using Funnelback's Selectable Metadata, only one document is needed for each item available for sale. In that document the price metadata is stored in the form of a string such as:
<meta name="price" content="4.10;5;(London;2.50)(Canberra;4.99)(Sydney;4.50)(Brisbane;4.63)(Szczecin;12.80)"/>
where 4.10 is the default price, 5 specifies that there are 5 exceptions, and the pairs of entries in parentheses show the prices which apply for the five different cities. When a person searches from a city, the city name can be inserted into the query string as a selector and the price shown and used in numerical range searches will be the one applicable to that city. For Melbourne, where no exception price is shown, the default price of 4.10 will be used.
Example 2: Multi-lingual environment
An online collection for a Swiss museum contains images of artefacts along with applicable metadata. Some of the metadata is language independent (e.g. catalogue number) but other metadata such as the description of the artefact needs to exist in more than one language, for example:
<meta name="artefactDescription" content="Steinaxt;3;(FR;hache de pierre);(EN;stone axe)(IT;ascia di pietra)"/>
Where the default description is in German but alternatives are available for French, English and Italian.