Metadata Search Field

Introduction

Funnelback uses metadata classes to index metadata, such as author and title, for the documents in a collection.

To query a metadata class you have to use a CGI parameter of the form meta_? for each metadata class. For example the CGI parameter:

meta_t=caesar

searches for documents whose title contain the term "caesar".

Query modifiers

The metadata CGI parameters can contain modifiers that add additional meaning to the query, for example

meta_t_not=brutus

negates the query: finding the documents whose titles do not contain brutus.

The full list of modifiers is:

ModifierDescriptionQuery expression
_andAnd's the terms+term1 +term2
_notNegates the terms-term1 -term2
_orOr[term1 term2 ]
_orsandOr with scoped And|[term1 term2 ]
_phrasePhrase"term1 term2"
_proxProximity`term1 term2`
_sandScoped And|term1 |term2
_truncWord truncation*term1* *term2*

Note: Word truncation is deprecated and only supported when using term at a time mode (-daat=0 or -service_volume=low).

This HTML will display an input box that allows the user to search for a particular phrase (_phrase modifier).

<label for="query_phrase">Search:</label>
<input id="query_phrase" type="text" name="query_phrase"
       value="${question.inputParameterMap["query_phrase"]!}">

Example 2: Any words

This example uses a _or modifier for document titles (metadata class t) that allows the user to search for any words in the title.

<label for="meta_t_or">Search for any of these words in the title</label>
<input id="meta_t_or"
       type="text" name="meta_t_or" size="20"
       value="${question.inputParameterMap["meta_t_or"]!}">

Dates

There are some special metadata parameters to handle dates:

meta_d

is an exact match to the date.

meta_d1

matches all dates greater than the supplied date (after).

meta_d2

matches all dates less than the supplied date (before).

meta_d3

matches all dates greater than or equal to the supplied date (from).

meta_d4

matches all dates less than or equal to the supplied date (to).Dates in queries are expressed as 25Dec2012.

The example below would match results with dates after 28th July, 1914 and before 11th November, 1918:

meta_d1=28Jul1914 meta_d2=11Nov1918

These parameters can be modified further by appending

  • day
  • month
  • year

The example below would match results with dates matching 25th April 1915:

meta_dday=25 meta_dmonth=Apr meta_dyear=1915

The example below would match results with dates from 1st September, 1939 to 2nd September, 1945:

meta_d3day=01 meta_d3month=Sep meta_d3year=1939 meta_d4day=11 meta_d4month=Sep meta_d4year=1945

Please note that d3 and d4 require all three components (day, month and year) to be provided, where as d, d1 and d2 permit, for example, just the year to be specified.

Search forms

Search forms can check for metadata in search results and display the metadata values if they are present. For example, to see if the author (metadata class a) exists and display it:

<#if s.result.metaData["a"]??>
     <span class="summary_label">Author:</span> ${s.result.metaData["a"]}
</#if>

See also

top