search
Search performs a search on a database using an Axiell Collections advanced search language statement.
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.
Performing searches
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 table 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 (.inf's) 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:
- comparison operators
The most common operators are: = > >= < <= for equals, greater than, greater than or equal, smaller than and smaller than or equal respectively. You cannot always establish whether a field is greater than or less than a particular value you enter. For example, you cannot ask whether a title field is greater than a number, unless that number relates to a number in the title. Use > >= < <= preferably for comparing numbers or dates.
There are also thenarrower
,broader
andgeneric
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 the mentioned 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 table 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 table). 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
- boolean combination
You may combine multiple single search statements to search on more than one criterium at once. Single search statements can be combined using Boolean operators AND, OR, or AND NOT.
- different index types
Database fields may have been indexed. Since an index allows for faster searching, fields which are searched on often, usually have an index. Axiell Collections distinguishes two basically different index types for indexing words: Text (aka term) indexes and Free text (aka word) indexes. The difference is that term indexes index the field content as a whole, while word indexes split up the contents of a field by separators and then index the individual words. The type of an index is determined by the setup in Axiell Designer. An example of a term indexed field is the author field, an example of a word indexed field is the title field.
The type of the index is important for the searching. If you were to search the value "man" in a word indexed field, e.g. in the title field, then you would retrieve all records that contain the word "man" somewhere in the title. If, on the other hand, you would search on a term indexed field for the word "man" then you would only get records in which the relevant field solely contains the term "man".
- multilingual searching
If a field is multilingual, you can search its data in a specific language. This ensures that all found records contain the searched term in the desired language. Provide the desired language code between square brackets behind the field name to search only in that language, like
title[nl-NL]
ortitle[en-US]
for example. If you leave out the language code behind a multilingual field, you will automatically search all available data languages.Sorting on a multilingual field is possible as well. In this case you must always indicate the data language on which must be sorted, behind the sort field name, in the same way as explained above.
Ingrouped
XML output, all language values of a multilingual field are returned asvalue
subnodes of the field node; the language code and invariancy flag per language value are returned as attributes to thevalue
nodes. Inunstructured
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.
Syntax
search=<expert search statement>&<parameter>=<value>&...
-
database
(String)
name of the database configuration on which to perform the search function. The name of this database table must have been specified in the adlibweb.xml file.
If the database configuration in the adlibweb.xml file of the database tablein 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 table will then be searched.
-
xmltype
(String)
[optional] type of XML to be returned (
grouped
orunstructured
).The Axiell WebAPI can return different forms of XML, but all XML output has some characteristics in common:
- The root element is named
adlibXML
. - All records are contained in a child element from the root with the name
recordList
. - Each record in the result set is contained in the record list in a
record
element. - The
recordList
element is followed by adiagnostics
element, which contains meta information about the search, such as the elapsed time and the number of records that were found. - The fields in the records are contained within each record element and have the English field name by which they are declared in the database .inf file
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.Of a multilingual field, 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.
Of an enumerative field, 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.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.Of a multilingual field, all language values are returned as
value
subnodes of the field node; the language code and invariancy flag per language value are returned as attributes to thevalue
nodes.Of an enumerative field, 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 thevalue
nodes, and are indicated by an Axiell Collections language number, not by their language code. The presentationlanguage
parameter does not apply to thegrouped
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 precedence 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 beunstructured
XML, regardless of what the diagnostics may indicate. An overview of differences between the wwwopac.exestructured
xmltype and the wwwopac.ashxgrouped
xmltype is documented here. - The root element is named
- limit (Integer) [optional] maximum amount of keys to return (default = 10).
- startfrom (Integer) [optional] first key number to return in the result (default = 1: the first key number in an index is 1).
-
fields
(String)
[optional] fields to be returned in the result XML. Which fields will actually be returned, is determined by 3 factors:
- the type of search statement.
- the fields that are made available for the type of search statement in adlibweb.xml.
- the fields that are requested in the call
The type of search statement
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
, wherennnn
is the record number (primary reference or priref) within the Axiell database table. When a search statement of this form is submitted, thedetailfields
section in the adlibweb.xml is used to determine which fields are returned. In all other cases thebrieffields
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.Request fields in the call
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 thefields
parameter, the caller can specify a comma separated list of fields in which it is interested. Thefields
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 thebrieffields
ordetailfields
section in adlibweb.xml. If you specify no fields behindfields=
, 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 specify 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
(String)
[optional] output format to be returned. Values for
output
can be eitherjson
orxml
(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.Read more about JSON output here.
-
callback
(String)
[optional] returns JSON output wrapped in brackets with your callback function name, for AJAX requests: <callback function name>( <JSON output> ); You don't need to specify
output=json
, because the output format is JSON by default. -
highlight
(Boolean)
[optional] encloses the searched key in <highlight> tags, in the result XML. It is possible as well to set this option as a default in the adlibweb.xml file, but since highlighting really is about the presentation of data, not about the structure (as XML should be), and because the result XML might be handled differently from request to request, optionally specifying highlighting per request could be a good compromise.
This parameter is available from wwwopac.ashx version 3.6.0.17162. -
facets
(String)
[optional] a comma-separated list of fields (their English names) or field tags to retrieve the facets (terms or names) from. The fields must have been indexed. This parameter is available for the
search
command andq=
searches and provides the same functionality as the now deprecatedfacets
command with the important difference that thefacets
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 oldfacets
command means having to perform asearch
to obtain a search result plus afacets
search for every facet list you need. - facetlimit (Integer) [optional] maximum amount of facets to return (default = 10).
Examples
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.)
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=all
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?search=all
The Axiell WebAPI can return different forms of xml, but all xml output has some characteristics in common:
- The root element is named
adlibXML
. - All records are contained in a child element from the root with the name
recordList
. - Each record in the result set is contained in the record list in a
record
element. - The
recordList
element is followed by adiagnostics
element, which contains meta information about the search, such as the elapsed time and the number of records that were found. - The fields in the records are contained within each record element and have the English field name by which they are declared in the database .inf file
There are different xml output types which can be used for different purposes:
- unstructured = flat structure: all fields are immediate childs of the record element.
- grouped = hierarchical structure: fields may be a child of the record element, or when a group name has been defined, a child of a group element. In this case the group element is a child of the record element.
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=all&xmltype=grouped
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=all&limit=4
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=all&limit=4&startfrom=5
The priref (primary reference) can be used to search on record number.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=priref>10
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=man
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=man*
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=people&search=name=jo*&xmltype=grouped
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=m*n
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=*men
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=m?n
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=creator=eng*&xmltype=grouped
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=priref=6&xmltype=grouped
Because the requested edit.name
field is part of a field group, and we specify xmltype=grouped
, the whole field group is returned.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=priref=6&xmltype=grouped&fields=edit.name,administration_name
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'.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=man,woman,child
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&q=co*
Note that the '+' needs to be hexadecimal encoded (as '%2b'), this is because the '+' character in a url is interpreted as a space.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=man%2bwoman
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=man-woman
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=man and dataset=intern
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title=man and dataset=intern,extern
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=creator=Batoni* when creator.role=painter
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).
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=(creator='hals, frans' or creator='Heemskerck, Maerten van') and title=portrait
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=creator='hals, frans' or creator='Heemskerck, Maerten van' and title=portrait
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).
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=input.date>'2009-01-01'
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=input.date>'2009-01'
The demo exhibitions database contains some records with an end data in February or March 2011.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=exhibitions&search=date.end>today&xmltype=grouped
The demo exhibitions database contains some records with an end data in February or March 2011. The "+" character must be URL encoded as "%2B".
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=exhibitions&search=date.end>today%2B7&xmltype=grouped
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=object_category=painting sort title descending
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=priref<100 sort OC, object_number&limit=50
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=creator=c* group creator sort creator, object_number&limit=10
If you know the number of the saved search you wish to retrieve, you can retrieve it using the search
command.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=people&search=pointer 2&xmltype=grouped
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=(pointer 3 or pointer 1) and creator=h*
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).
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=profile 6
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=profile 3
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=profile 6 and not pointer 6
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=all random 5 seed 84
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=all random 5
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
.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=modification greater '2008-01-01'
You can search phonetically, using the following syntax: field phonetic value
.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title phonetic team
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=(creator->all) and (object_category->term=painting)
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=creator->pointer 1
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=creator->(address.place=antwerpen and birth.date.start>'1500-01')
- no further description -
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=creator->address.place->edit.date>'2010-03-31'
Having highlight information in the XML result can be useful when transforming the XML for presentational purposes.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=object_category=painting&highlight=true
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).
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=title[nl-NL]='allegorisch'&xmltype=grouped
If you sort on a multilingual field, it is required that you indicate the data language on which must be sorted.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=object_category='sketch' and priref<247 sort title[en-US] descending&xmltype=grouped
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=priref=10&language=nl-NL
See the previous example for more information.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=priref=10&xmltype=grouped
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:
- First, wwwopac determines whether your search key is one of the defined neutral values in the enumerative field or one of the English "translations" (other display languages not supported yet). This can be determined by the WebAPI before the search is executed because the neutral values and their translations of the field have been set in the database .inf file.
- a. If the search key is a neutral value (the indexed enumerative value actually stored in records), the actual search will be performed on the neutral values corresponding to the used logical expression. So if you'd have an enumerative list with neutral values BOR, AAB, ZET and ELF, and you would search on
>=ELF
, wwwopac would search the index of the enumerative field on the values ELF and ZET.
b. If the search key is an English display value, as you could see when you viewed an appropriate record in Axiell Collections with the interface language switched to English, wwwopac would determine its associated neutral value using the .inf and then perform the actual search on the neutral values corresponding to the used logical expression. So if you'd have an enumerative list with neutral values BOR, AAB, ZET and ELF with the respective English display values Super, Fine, Mediocre, Bad, and you would search on<=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.Further, in wwwopac.ashx version 3.7.14038, searching an enumerative field on everything but the search key, using <>, has been fixed: previously, an = search was performed instead of a <> search. The logic of an unequal-search is similar to that of a larger-than or smaller-than search.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=content.person.name.type=person
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=library-marc&search=title=house*
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=collect.inf&search=fields_modification_date>'2011-06-26'
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.
https://webapi.axiell.com/demowebapi/wwwopac.ashx?database=ChoiceFullCatalogue&search=(tr%20narrower%20'Africa')&limit=60&startFrom=1&xmlType=Grouped&highlight=1
Examples
string url = "https://webapi.axiell.com/demowebapi/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");
// 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");
// 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");
// 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)");
Syntax
$().adlibdata(<wwwopac.ashx url>, {<args>}, <call back function> );
Examples
var url = "https://webapi.axiell.com/demowebapi/wwwopac.ashx"; $().adlibdata(url, { //arguments database: "collect.inf", search: "all", xmltype: "unstructured" }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });
var url = "https://webapi.axiell.com/demowebapi/wwwopac.ashx"; $().adlibdata(url, { //arguments database: "collect.inf", search: "all", xmltype: "unstructured", startfrom: 1, limit: 4 }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });
var url = "https://webapi.axiell.com/demowebapi/wwwopac.ashx"; $().adlibdata(url, { //arguments database: "collect.inf", search: "all sort creator ascending", xmltype: "unstructured" }, function (adlibJSON) { alert(adlibJSON.diagnostic.hits); });
var url = "https://webapi.axiell.com/demowebapi/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); });