Search performs a search on a database using an Axiell Collections advanced search language statement.
search=<expert search statement>&<parameter>=<value>&...
If the database configuration in the adlibweb.xml file of the database in which you want to search has been marked as the default database configuration, then you don't need to include the database parameter in this query: the default database will then be searched.
grouped
or unstructured
).
The Axiell WebAPI can return different forms of XML, but all XML output has some characteristics in common:
adlibXML
.recordList
.
record
element.recordList
element is followed by a diagnostics
element, which contains meta information about the search, such as the elapsed time and the number of records that were found.There are different XML output types which can be used for different purposes:
unstructured
= flat structure: all fields and their occurrences are immediate children of the record element. If a field has multiple occurrences, then all those occurrences are listed directly below each other.language
parameter followed by a standard language code without square brackets around it, in which case only the relevant translation is returned, directly in the enumerative field node.grouped
= hierarchical structure: fields may be a child of the record element, or when a field group name has been defined in the data dictionary, a child of a group element with the name of the group. In this case the group element is a child of the record element. If at least one of the fields in a field group has multiple occurrences, then the entire field group is repeated as many times. Empty occurrences of fields in a field group are retrieved as well.value
subnodes of the field node; the language code and invariancy flag per language value are returned as attributes to the value
nodes.value
subnodes underneath the enumerative field node; the presentation languages are attributes to the value
nodes, and are indicated by an Axiell Collections language number, not by their language code. The presentation language
parameter does not apply to the grouped
XML output type.The default xmltype
is determined by the adlibweb.xml configuration file at the server, but any xmltype specified here in the search statement has precendence over any xmltype specified in the adlibweb.xml file.
The structured
xmltype, as could be used with wwwopac.exe, has not been implemented for searches in wwwopac.ashx, although it has been for saved searches (aka pointer files). If you do use it with a search, the result will be unstructured
XML, regardless of what the diagnostics may indicate. An overview of differences between the wwwopac.exe structured
xmltype and the wwwopac.ashx grouped
xmltype is documented here.
There are two types of search statements: statements that result in a set of 0 or more records and statements that result in no record at all or otherwise in a single record. The last type of search statements always has the form: priref = nnnn
, where nnnn
is the record number (primary reference or priref) within the Axiell database. When a search statement of this form is submitted, the detailfields
section in the adlibweb.xml is used to determine which fields are returned. In all other cases the brieffields
section in the adlibweb.xml is used to determine the returned fields. The idea behind this is that when a search results in more than one record you probably want to display a list of records, with a limited set of fields. When a search results in exactly one record you are probably interested in more fields.
In addition to what is specified in the adlibweb.xml file, the caller can also specify which fields are returned by specifying a fields
parameter. Using the fields
parameter, the caller can specify a comma separated list of fields in which it is interested. The fields
parameter acts as an additional filter on what is specified in the adlibweb.xml file. In other words: you cannot ask for fields that are not also in the brieffields
or detailfields
section in adlibweb.xml. If you specify no fields behind fields=
, only the priref will be returned; by default the priref is always retrieved.
Obviously if you just need a couple of specific fields then it makes perfect sense to specifiy them in your calling URL: the returned XML will be much smaller. Also note that when you request a field that is in a group then you will get the whole group returned if you specify xmltype=grouped
, even if you just ask for a single field in the group.
output
can be either json
or xml
(xml
is the default, so you don't need to specify that explicitly). However, the output format produced by jQuery applications is always JSON, so you don't need to specify the output type there either.output=json
, because the output format is JSON by default.
search
command and q=
searches and provides the same functionality as the now deprecated facets
command with the important difference that the facets
parameter allows the result of any search to include lists of retrieved facets, so that only a single search yields all required data to present a search result and multiple facet lists, whereas using the old facets
command means having to perform a search
to obtain a search result plus a facets
search for every facet list you need.
Almost any advanced search statement can be entered behind search=
, but the syntax is not always self-evident and the Axiell WebAPI offers extended search language functionality over that of Collections. The examples below provide an overview of the expert search language functionality implemented in the Axiell WebAPI.
The basic form of a URL request for a search
is wwwopac.ashx?database=<database name>&search=<search statement>&<parameter>=<value>&...
, in which the database name is the database to be queried, as specified in adlibweb.xml, and the search statement is the Axiell Collections advanced search statement that will be performed. The advanced search language serves as the basis for all WebAPI searches. In principle, any advanced search statement can be passed on to the web service to retrieve records, although as of yet, not all search language functionality is actually available.
If search=
is omitted from the query while you did specify a search statement, then an Adlib.Query.NoSearchStatementException error is returned.
The Collections advanced search language is optimized for information retrieval. Basic searches are composed using the following structure: field_name operator search_value
. The field name is the name of a field as it has been specified in the Axiell data dictionary (using Axiell Designer). A list of field names can be obtained from the web service using the getmetadata
command. In a search you can also use the tag of the field, instead of the field name.
As of yet, you can only search on fields which have been indexed. (Searching on non-indexed fields will produce an Adlib.Query.UninplementedSearchLeafException error.)
The Axiell Collections advanced search language includes:
narrower
, broader
and generic
operators for searching hierarchically. Say you'd like to do a search for objects or containers within a certain location (so you'd want to search on a location and the locations underneath it), using the location's barcode as the search key instead of the location name (where location records are hierarchically linked on name, so the barcode field is a merged-in field), then from WebAPI version 3.0.22025.1 you can with said three hierarchical operators for a either a search on all narrower terms, on all broader terms, or (generic) on all narrower terms including the search key itself respectively. These operators can be used for linked fields where the linked database has the hierarchical internal link defined (bt/nt) as well as for local indexed fields (other than the term indexed field for the hierarchical internal link in the current database). Two examples of both situations:
wwwopac.ashx?database=collect&search=current_location.barcode generic DIU.V106
wwwopac.ashx?database=package&search=barcode broader DIU.V712
title[nl-NL]
or title[en-US]
for example. If you leave out the language code behind a multilingual field, you will automatically search all available data languages.grouped
XML output, all language values of a multilingual field are returned as value
subnodes of the field node; the language code and invariancy flag per language value are returned as attributes to the value
nodes. In unstructured
XML output, only the value of the currently searched data language is returned, and it is returned directly in the field node, without language or invariancy attributes.
A full description of the advanced search language is documented in the Axiell Collections online Help.
Although most advanced search statements will function in their original notation, it is preferred (and sometimes necessary) to escape special characters like spaces (by a + or the hexadecimal encoding of a space: %20), a > symbol (by the word 'greater' or the hex value %3E), a < symbol (by the word 'smaller' or the hex value %3C) or quotes (by their hex value %27). The necessity to do so might arise from the programming language in which a URL is called: a > symbol in a URL in XML or HTML for example, could be interpreted as a closing tag, so you need to escape it to prevent this from happening.
Search all records: return all records from collect.inf show
The keyword statement 'all' is a special advanced search language element to retrieve all records. It is the only exception to the rule that all search statements must have the syntax field operator value
. The example only returns 10 records. This is a default limit, that can be overridden by the limit
argument. (The diagnostic/hits node in the XML search result contains the total number of records found.)
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all
Search all records: return all records from the default database (collect.inf) show
In adlibweb.xml, collect.inf
has been marked as the default database. By not specifying a database in the query, the default database will be searched. If no default database has been specified, then searching without the database
parameter will result in an error.
http://test2.adlibsoft.com/api/wwwopac.ashx?search=all
Search all records, specify xmltype: return all records from collect.inf in the xmltype 'grouped' show
The Axiell WebAPI can return different forms of xml, but all xml output has some characteristics in common:
adlibXML
.recordList
.record
element.recordList
element is followed by a diagnostics
element, which contains meta information about the search, such as the elapsed time and the number of records that were found.There are different xml output types which can be used for different purposes:
You can specify the required xml type in the xmltype
argument of a search
. The default xmltype
is determined by the adlibweb.xml parameter file at the server.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all&xmltype=grouped
Search all records and limit the result: from all records in collect.inf, return the first 4 show
By default, the limit
argument starts counting from the first record found by the search statement. If you specify limit=0
then this means that no limitation is put on the result set, potentially leading to huge xml documents. You can also set limit
to a negative value, e.g. -1. This prevents any records to be returned, but can be useful if you are just interested in the diagnostics part in the resulting xml, for instance to find out how many records a search would return without actually returning the search result itself.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all&limit=4
Search all records, limit the result, and skip records: from all records in collect.inf, return the fifth, sixth, seventh and eighth record show
The limit
argument can be combined with the startfrom
argument to implement paging through result sets. The startfrom
argument determines which record in the result set is going to be the first in the resulting XML. In other words: if you specify startfrom=5
then the first 4 records in the result set are skipped in the resulting xml.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all&limit=4&startfrom=5
Search on record numbers higher than 10 show
The priref (primary reference) can be used to search on record number.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=priref>10
Search an index for specific value: from all records in collect.inf, return the records with the whole word 'man' in the title show
The word 'man' must appear in the searched field as a whole. It doesn't matter whether the searched field is indexed as a word (free text) index or term index.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=man
Right truncation: from all records in collect.inf, return the records with the partial or whole word 'man' in the title show
Normally, searching on a word means searching on the whole word, but you can search on partial words as well. This is called truncated searching. In a search statement, truncation must be indicated explicitly using a wildcard. The only available wildcard is the asterisk: it may replace multiple characters. You can search left, middle and right truncated; the database indexes don't need any special settings to achieve this. For instance: if we want to search for words in the title field which start with "man", then we would have to make it a truncated search using an asterisk. This will not only find the word "man", but also words like "mandolin", "many", etc.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=man*
Right truncation: from all records in the people database, return the records with the partial or whole name 'jo' show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=people&search=name=jo*&xmltype=grouped
Middle truncation: search a word index for words starting with "m" and ending with "n" show
If we want to search for words in the title field which start with "m" and end with "n", then we would have to make it a middle truncated search. This will not only find the word "man", but also words like "mandolin", "mean", etc.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=m*n
Left truncation: search a word index for words ending on "men" show
If we want to search for words in the title field which end with "men", then we would have to make it a left truncated search. This will not only find the word "men", but also words like "women", "amen", etc.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=*men
Wild card truncation using a question mark: search a word index for three-letter words starting with "m" and ending with "n" show
From wwwopac.ashx version 3.7.14042, a question mark can be used as a single-character wild card for searches in word (free text) indexed fields. For example: searching for the string 'm?n'
would find words like 'man', 'men', 'mcn', etc., but not 'moon' or 'meaning'. Using '?' as a single-character wild card was already functional for term indexes, but not for word indexes yet.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=m?n
Determine the fields to return: of a record found with a non-priref search, automatically the brieffields are returned show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=creator=eng*&xmltype=grouped
Determine the fields to return: of a record found with a priref search, automatically the detailfields are returned show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=priref=6&xmltype=grouped
Determine the fields to return: of a record found with a priref search, request only two specific fields from the detailfields show
Because the requested edit.name
field is part of a field group, and we specify xmltype=grouped
, the whole field group is returned.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=priref=6&xmltype=grouped&fields=edit.name,administration_name
Boolean OR: use a comma as 'or' to search for multiple words in the title field show
In the advanced search language simple search statements formatted like field operator value
can be combined with Boolean operators 'and', 'or' and 'and not'. There is also the special 'when' operator. 'when' is an 'and' operator which says that the two searched values must be found in the same occurrence number of the two fields. You can use this operator to make sure that the right values from a repeated field group are combined in the search.
There are shortcut notations for searching multiple values in the same field, these are '+' for 'and', a comma for 'or' and '-' for 'and not'.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=man,woman,child
Perform an implicit OR search in all the search fields as defined in adlibweb.xml show
If in your adlibweb.xml, search fields have been specified (next to the brief and detail fields) then you can use the q=search_key
syntax to search all these fields at once. If the searched value appears in at least one of the search fields, the record will be part of the search result. This example searches the creator, title, object category and object number fields.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&q=co*
Boolean AND: use a plus as 'and' to search for multiple words in the title field show
Note that the '+' needs to be hexadecimal encoded (as '%2b'), this is because the '+' character in a url is interpreted as a space.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=man%2bwoman
Boolean AND NOT: use a minus as 'and not' to search for 'man' and not 'woman' in the title field (what's a man without a woman ;-) show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=man-woman
Search a dataset with Boolean AND: search for records with the word 'man' in the title, but only in the Internal object catalogue dataset show
Instead of searching a entire database, you can perform a search in one or more particular datasets of a database as well. Note that not all databases are subdivided into datasets.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=man and dataset=intern
Search two datasets with Boolean OR: search for records with the word 'man' in the title, appearing in at least one of both datasets in collect.inf show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title=man and dataset=intern,extern
Search a dataset with Boolean WHEN: search truncated for records where the creator 'Batoni' has the role 'painter'. show
The WHEN operator is used when searching for two record details appearing in the same occurrence of a field group. Creator and Role are part of the same (repeatable) field group. So the example only finds records in which 'Batoni' is the (first part of the) name of one of the creators while he has the role 'painter'. If 'Batoni' and 'painter' do not appear in the same field group occurrence, the record won't be retrieved.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=creator=Batoni* when creator.role=painter
Boolean searching using parentheses: retrieve portraits by Frans Hals or Maerten van Heemskerck show
Boolean operators can be combined to make really complex searches. The 'and' operator has precedence over the 'or' operator. The normal precedence of execution order is: = WHEN AND OR, and left to right. The operator precedence can be influenced (like in ordinary math) by using parentheses.
The diagnostic node in the returned xml displays how wwwopac.ashx interprets the incoming queries (it adds extra parentheses for operator precedence).
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=(creator='hals, frans' or creator='Heemskerck, Maerten van') and title=portrait
Boolean searching using parentheses: retrieve portraits by Maerten van Heemskerck plus anything else by Frans Hals show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=creator='hals, frans' or creator='Heemskerck, Maerten van' and title=portrait
Date (range) searching: search on records entered into the database after January 1, 2009 show
As of yet, you can only search on indexed date fields. In our test database, the input.date and edit.date fields (tags di and dm) are such indexed date fields.
Dates have to be entered in the format in which they appear in the database. In our test database, this is the ISO date format: yyyy-mm-dd.
Truncated searching on dates is not possible. If you just want to search on year, or year and month, for example, then use >, <, >= or <= in combination with a full date (although only a year and month suffice as well).
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=input.date>'2009-01-01'
Date (range) searching: search on records entered into the database after January 1, 2009 (short notation) show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=input.date>'2009-01'
Retrieve all exhibitions which have not ended yet show
The demo exhibitions database contains some records with an end data in February or March 2011.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=exhibitions&search=date.end>today&xmltype=grouped
Retrieve all exhibitions which end after next week show
The demo exhibitions database contains some records with an end data in February or March 2011. The "+" character must be URL encoded as "%2B".
http://test2.adlibsoft.com/api/wwwopac.ashx?database=exhibitions&search=date.end>today%2B7&xmltype=grouped
Sorting a search result: search on object category 'painting' and sort descending on title show
By default, records in the search result are sorted on the record number. So if you want to sort on any other field(s), you must specify it in the search statement. Sorting can be applied using one or more* indexed or linked fields. (This keeps response times to a minimum: sorting this way can be handled server-side in a single sql statement.) If explicit sorting on the first field falls short, for instance because the sort field is empty in more than one record, or has the same value in more than one record, the next specified sort field is employed, and if no next sort field has been specified, the relevant records will be sorted on record number.
The sort part of a search statement uses the following syntax: sort field_name|field_tag [ascending|descending], field_name|field_tag [ascending|descending], ...
, the default sort order being ascending. Sorting automatically takes place on the data type of the index, so that dates are sorted chronologically and numerical fields are sorted numerically, while text is sorted alphabetically. To find out if a field in the demo database is indexed or linked, use the getmetadata
command.
See the next example for more information about sorting on multiple fields and on repeated fields.
* Sorting on more than one field is possible from version 3.6.0.25721.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=object_category=painting sort title descending
Sorting a search result: search record numbers smaller than 100, and sort ascending, first on object category and secondly on object number show
In this example, all records are sorted ascending (default) on object_category (tag OC, or use the field name instead), and if more than one record has an identical object category (there might be multiple records with the object category "painting" for example), then these records are sorted according to their object number. Note that object_number is a text field, not an integer field, so object numbers may and do contain letters and are therefor sorted alphabetically, not numerically. Also note that empty values are sorted before numbers, and numbers before letters. So if certain records do not have an object category, then these will be listed first, sorted according to object number. Note that prior to version 3.6.0.25721, records with empty sort fields were not included in the search result.
If you sort on a repeatable field, like object_category, records may appear more than once in the search result: actually, it appears as many times as the number of occurrences of the field in the record. For example, if an object has been categorized as both a "painting" and "religious art" object categories, it will sorted once on "painting" and once on "religious art". However, it is not always desirable that a record appears more than once in the search result, in which case you would probably want to sort on the first occurrence of the field only. This is only possible for non-linked fields though. See the FAQ about this topic for information about setting that up.
See the previous example for more information about sorting.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=priref<100 sort OC, object_number&limit=50
Group and sort: search for creators starting with 'c', sort the search result on creator and object number and apply a flexible limit show
Before display and before any limit is applied, the group
parameter groups the complete search result by the values found in the specified field, so that all records with an identical value in the group field can be retrieved together. If you decide to use this parameter, you must also sort
the search result on the group field (using the syntax explained in the examples above), e.g: search=object_category=photo* group creator sort creator
. (If no explicit sort
parameter would be specified, the search result would be sorted on record number (priref) by default and the grouping would fall apart, as it would too if you'd explicitly sort on any other field but the group field first.)
Only after grouping and sorting, will the limit be applied, but in a flexible way: the WebAPI will look at the relevant field value in the last record of the would-be displayed search result after the specified limit would have been applied and subsequently tries to retrieve as much other sorted records in that group as possible until maximally 50% more records have been retrieved. So if the limit is 10 and search=object_category=photo* group creator
would give 31 hits while the 10th record contains creator Cahun, Claude, and there are 12 more records with this creator, then 5 more will actually be retrieved in the first search result of 15 records (exceeding the limit by exactly 50% here).
Within each group you can sort on multiple fields if you wish, but the first sorting field should always be the group field, otherwise the grouping falls apart. For example: suppose you'd like a list of all photos sorted by creator first and secondly by their creation date, then the displayed search result might be most useful when of each creator present in there ALL photo records would be included, even if that would mean that the search result limit would be exceeded somewhat (currently fixed at 50% maximum). Without the group
parameter, sorting is also applied before the search result is limited, but the page break always comes exachtly after the specified limit. See the group
parameter as a way to automatically get your search result page breaks neatly between two different values of your sorting field as much as possible.
If you plan on using this functionality it is good to realize that the size of the limit is important in getting the desired search results but also that you might not be able to guarantee that displayed groups always contain all relevant records, since the flexible limit still has a maximum.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=creator=c* group creator sort creator, object_number&limit=10
Search for specific saved searches (pointer files): retrieve all records from saved search 2 in people show
If you know the number of the saved search you wish to retrieve, you can retrieve it using the search
command.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=people&search=pointer 2&xmltype=grouped
Search for specific saved searches (pointer files): retrieve all records from saved search 3 and 1 in collect.inf, for which the creator starts with an 'h' show
Since you can enter a full advanced search language statement behind search
, you may combine the retrieval of one or more saved searches with searches on fields.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=(pointer 3 or pointer 1) and creator=h*
Search for specific saved searches (pointer files): retrieve all records from saved search 6 after profiling it show
Via a search statement you can also "profile" a saved search (pointer file). Profiling means that the search statement on which the saved search is based, will be executed again before retrieving the resulting records; the result will not be stored in the saved search though! This ensures that the result set is up to date with any changes in the database. It means that a profile can only be executed on a saved search that was created from a search. Saved searches which contain a hand picked result set (accomplished by marking records) do not contain a search statement and can therefore not be profiled (trying to do so anyway produces an error message).
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=profile 6
Search for specific saved seaches (pointer files): trying to profile a hand picked saved search produces an error show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=profile 3
Search for specific saved searches (pointer files): retrieve all records from a profiled saved search 6, which are not in the old saved search show
If you just want to know which records are new in the result set after profiling a saved search, you can use a combined search applying both profile
and pointer
. Of course, if after profiling, the result set is the same as the stored saved search, this search will yield no records. Note that profiling a saved search through the WebAPI will not write back the result to the saved search, so the saved search itself remains unchanged.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=profile 6 and not pointer 6
Select a random result set: retrieve a fixed, random set of 5 records from the search result show
You can let the WebAPI select a random set of records from the search result. In the search statement you have to indicate to how many randomly chosen records you wish to reduce the total search result. The random
command must be following the search
statement, and has the following syntax: random limit number [seed seed number] [unique]
. The limit number is the number of records you wish to end up with. The seed number is optional, and will create a fixed, random result: this means that although the seed number is used to generate a random result set, this result set will be identical every time this exact search statement is executed in an unchanged database. The optional unique
argument specifies that a record may only occur once in the result set.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all random 5 seed 84
Select a random result set: retrieve a random set of 5 records from the search result show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all random 5
Searching on SQL table metadata: retrieve records from collect.inf, modified after 2008-01-01 show
Each Axiell Collections record is stored in a row of a SQL table. A row is made up of different columns, containing metadata and the actual record data. The metadata column headers can be treated as pseudo fieldnames, and therefore you may perform a search on any of these metadata columns, like priref, creation and modification (although the indexed and owner columns are not being filled yet). The search statement follows the rules of the advanced search language.
Be aware that creation and modification are datetime
type fields, including both a date and a time. If you specifiy exact (=) searches you will have to specify the time as well as the date, e.g. creation = '2007-2-7T14:40:36'
, but of course you can use greater
and smaller
to search on just a date or a year. Don't forget the quotes around the date, otherwise the minus will be interpreted as AND NOT
.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=modification greater '2008-01-01'
Searching phonetically: search the title field on words that sound like "team" show
You can search phonetically, using the following syntax: field phonetic value
.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title phonetic team
Searching remote indexes: search all objects which have a creator and an object category "painting" show
Searching remote indexes is the ability to search in any (indexed) field in linked databases. In the advanced search language in Axiell Collections you can search the index of the linked field, for instance the title index for linked documents or the creator index for makers, and other indexed fields in those linked document records or object records can be searched if those fields are merged in with linked fields (as specified in their link definition). The WebAPI however, cannot search these other indexed fields in the linked database in the same way that Axiell Collections can. The SQL search language has a solution for this problem though, so for wwwopac.ashx working on SQL Server Axiell databases, a long standing wish has come true with the addition of indirection functionality for searching remote indexes in linked fields. You can use it to perform searches like "search for all the paintings of artists who lived in amsterdam before 1800". The principle also applies to internally linked fields, by the way. For this functionality, a new operator is introduced, namely -> (which is the indirection symbol). The right hand side of an -> expression can be a complete Axiell Collections advanced search statement.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=(creator->all) and (object_category->term=painting)
Searching remote indexes: search all objects which have a creator that is present in saved search 1 in the database which holds creator names show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=creator->pointer 1
Searching remote indexes: search all objects which have a creator who lived in Antwerpen and was born after the beginning of 1500 show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=creator->(address.place=antwerpen and birth.date.start>'1500-01')
Searching remote indexes: search all objects which have a creator who lived in a place of which the term record was edited after 2010-03-31 show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=creator->address.place->edit.date>'2010-03-31'
Search for the object category "painting" and in the XML result, enclose "painting" in <highlight> tags show
Having highlight information in the XML result can be useful when transforming the XML for presentational purposes.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=object_category=painting&highlight=true
Search the multilingual title field for Dutch titles which contain the word 'allegorisch', but retrieve a title in all translations show
If a field is multilingual, like the title field in our demo collect database, you can search its data in a specific language. This works the same as it does in the advanced search language of Axiell Collections: provide the desired language code behind the field name to search only in that language, like title[nl-NL]
, title[en-US]
or title[el-GR]
here in the demo. If you change the language code in this search command to [en-US]
you will also have to change the search term to 'allegorical'
if you want to find the same record. If you leave out the language code altogether you will automatically search all available data languages.
The XML output type determines if all translations of a found title will be retrieved (grouped
XML) or just the title in the language you searched on (unstructured
XML).
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=title[nl-NL]='allegorisch'&xmltype=grouped
Search for all records with the object category 'sketch' and a record number lower than 247, and sort descending on the English titles only. show
If you sort on a multilingual field, it is required that you indicate the data language on which must be sorted.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=object_category='sketch' and priref<247 sort title[en-US] descending&xmltype=grouped
Retrieve a record in unstructured XML output to obtain only the Dutch translation of the neutral value of enumerative field contents show
The definition of an enumerative field consists of a list of so-called neutral values which represent the choices available to a user in the relevant drop-down list in a record in edit mode. With every neutral value, a number of translations have been specified as well, in as many languages as there are user interface languages in your Collections application. For example, if a user turns on the Dutch interface language via the Language switch menu, the available translations of the enumerative field allow Collections to show Dutch values in the drop-down list only. However, the enumerative value which is actually stored in the record is the neutral value (which may not even be a readable word). So when you retrieve a record via wwwopac.ashx, which contains values from enumerative lists, you will want to have control over which translation(s) and/or the neutral value are returned. In the default unstructured
XML output type, only the neutral value is returned, directly in the enumerative field node, unless you specify the presentation language with the language
parameter followed by a standard language code without square brackets around it, in which case only the relevant translation is returned, directly in the enumerative field node. In the grouped
XML output type however, both the neutral value and all available translations of the enumerative value are returned, in value
subnodes underneath the enumerative field node; the presentation languages are attributes to the value
nodes, and are indicated by an Axiell Collections language number, not by their language code. The presentation language
parameter does not apply to the grouped
XML output type.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=priref=10&language=nl-NL
Retrieve a record in grouped XML output to obtain all translations and the neutral value of enumerative field contents show
See the previous example for more information.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=priref=10&xmltype=grouped
Search for records in which the neutral value 'person' has been stored in the enumerative content name type field show
Searching an enumerative field with the = operator allows you to enter any of the neutral values as the search key. (See the example description prior to the previous one for more information about the structure of enumerative fields.)
From wwwopac.ashx 3.7.14041, larger-than and smaller-than searching in enumerative fields, using > (alphabetic succession), >= (alphabetic succession or equal to), < (alphabetic precedence) or <= (alphabetic precedence or equal to), works as follows:
>=ELF
, wwwopac would search the index of the enumerative field on the values ELF and ZET. <=fine
, wwwopac would search the index of the enumerative field on the value AAB alone, not on any of the other values (because in alphabetical sense there exist no enumerative values for this field which precede AAB. So in this case you wouldn't find records displaying the enumerative field value Bad. Note that the order of values in the list (or their meaning) is irrelevant to this functionality. http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=content.person.name.type=person
Perform a search and transform the Axiell AdlibXML result by means of a stylesheet set in the current database configuration. show
Per databaseConfiguration
in the adlibweb.xml file, you have the option to set an XSLT stylesheet to transform the Axiell AdlibXML result which is produced by wwwopac.ashx by default. For the 'library-marc' database such a stylesheet has been set.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=library-marc&search=title=house*
Retrieve records modified in selected fields after a certain date, by means of a compound metadata index for the selected fields. show
From 6.6.0, certain metadata is stored in each field of which the content has been edited, namely the creation and/or edit date and the name of the user. In our demo collect database we've created a single index on the modification date of 24 fields. (fields_modification_date
is the name we gave the dummy field which is indexed first.) With below query we can retrieve only those records in which at least one of the values in the selection of 24 fields has changed after the indicated date.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=fields_modification_date>'2011-06-26'
Perform a 'narrower' search on the keyword "Africa" and highlight the term "Africa" if found. show
All records with the keyword "Africa" are retrieved, as well as records with keywords that are narrower terms of "Africa", like "Botswana" for example (see the last record). The narrower search only works in SQL databases in which records are stored in XML, not in binary format.
http://demo.adlibsoft.com/wwwopacx/wwwopac.ashx?database=ChoiceFullCatalogue&search=(tr%20narrower%20'Africa')&limit=60&startFrom=1&xmlType=Grouped&highlight=1
- no Adlib.Data-specific description available yet; see the URL request tab for all information -
Search all records: return all records from collect.inf show
string url = "http://test2.adlibsoft.com/api/wwwopac.ashx"; // Create a connection to the wwwopac.ashx AdlibConnection conn = new AdlibConnection(url); // Prepare a record set for results AdlibRecordSet recordSet = new AdlibRecordSet(conn, "collect.inf"); // Set the type of XML returned recordSet.XmlType = XmlType.Unstructured; // Do the search recordSet.Search("all");
Search all records, limit the result, and skip records: from all records in collect.inf, return the first four records show
// Prepare a record set for results AdlibRecordSet recordSet = new AdlibRecordSet(conn, "collect.inf"); // Set the type of XML returned recordSet.XmlType = XmlType.Unstructured; // Set the startfrom and limit recordSet.StartFrom = 1; recordSet.Limit = 4; // Do the search recordSet.Search("all");
Sorting a search result: from all records, return the first four and sort them ascending on creator name show
// Prepare a record set for results AdlibRecordSet recordSet = new AdlibRecordSet(conn, "collect.inf"); // Set the type of XML returned recordSet.XmlType = XmlType.Unstructured; // Set the sort field and order recordSet.Sort = "creator"; recordSet.Sequence = AdlibRecordSet.SortSequence.Ascending; // Do the search recordSet.Search("all");
Boolean searching using parentheses: retrieve portraits by Maerten van Heemskerck plus anything else by Frans Hals show
// Create a connection to the wwwopac.ashx AdlibConnection conn = new AdlibConnection(url); // Prepare a record set for results AdlibRecordSet recordSet = new AdlibRecordSet(conn, "collect.inf"); // Set the type of XML returned recordSet.XmlType = XmlType.Grouped; // Do the search recordSet.Search("creator='hals, frans' or (creator='Heemskerck, Maerten van' and title=portrait)");
$().adlibdata(<wwwopac.ashx url>, {<args>}, <call back function> );
- no jQuery-specific description available yet; see the URL request tab for all information -
Search all records: return all records from collect.inf show
var url = "http://test2.adlibsoft.com/api/wwwopac.ashx"; $().adlibdata(url, { //arguments database: "collect.inf", search: "all", xmltype: "unstructured" }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });
Search all records, limit the result, and skip records: from all records in collect.inf, return the first four records show
var url = "http://test2.adlibsoft.com/api/wwwopac.ashx"; $().adlibdata(url, { //arguments database: "collect.inf", search: "all", xmltype: "unstructured", startfrom: 1, limit: 4 }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });
Sorting a search result: from all records, return the first four and sort them ascending on creator name show
var url = "http://test2.adlibsoft.com/api/wwwopac.ashx"; $().adlibdata(url, { //arguments database: "collect.inf", search: "all sort creator ascending", xmltype: "unstructured" }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });
Boolean searching using parentheses: retrieve portraits by Maerten van Heemskerck plus anything else by Frans Hals show
var url = "http://test2.adlibsoft.com/api/wwwopac.ashx"; $().adlibdata(url, { //arguments database: "collect.inf", search: "creator='hals, frans' or (creator='Heemskerck, Maerten van‘ and title=portrait)", xmltype: "grouped" }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });