The Search API, the search widget and other DigitalNZ search tools share a powerful search syntax borrowed from the Apache Lucene search engine.
You can test your query syntax using DigitalNZ Search. Note that the results from the DigitalNZ Search interface, may vary slightly from the results returned directly via the API as some material can be blocked from the interface, but still available from API.
The DigitalNZ search system uses Apache Lucene syntax, which is fully described in the Apache Lucene Query Parser Syntax documentation.
Lucene syntax is very powerful, and gives you access to numerous features, including fielded search, boolean operators, Google-style operators, nesting and grouping, proximity operators, wildcards, even fuzzy search.
You can search for text in a specific field by entering field:value in your search string, eg category:Images.
Note that DigitalNZ generates the year, decade and century values based on any date metadata associated with a record.
Date indexed fields can be searched using date range syntax. Fields that can be searched using date range indexing include
The "text" field is the default search field: if you do not specify a field explicitly, the text field will be searched.
The text field contains a copy of all these fields: title, description, category, content_partner, creator, subject, year, placename, and fulltext.
Complex queries can be built up using boolean operators (AND, NOT) and with field searches using field:value syntax.
For example, results for the name 'William' from within the Dictionary of New Zealand Biography website:
http://api.digitalnz.org/records/v1.xml/?search_text=william%20AND%20collection:"Dictionary+of+New+Zealand
+Biography"&api_key=your_api_key
For example, last modified records from Flickr:
http://api.digitalnz.org/records/v1.xml/?search_text=last_modified_at:[2010-03-13T00:00:00.000Z%20TO%20*]%20AND%20collection:%22Flickr%22&api_key=your_api_key