Index Search API
GET (opensearchdescription.xml)
Returns an auto-generated OpenSearch Description document for the current index.
Request
GET /lucene/test/opensearchdescription.xml HTTP/1.1 Host: localhost:8080
Response
HTTP/1.x 200 OK
Content-Type: application/opensearchdescription+xml;charset=utf-8
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>My test index</ShortName>
<Description>OpenSearch description for 'My test index'</Description>
<Url template="http://localhost:8080/lucene/test/?query={searchTerms}&limit={count}&offset={startIndex}&page={startPage}&locale={language}" type="application/atom+xml"/>
</OpenSearchDescription>
Errors
404 Not Found
The index does not exist. Clients should not attempt another request for this URL.
500 Internal Server Error
There was a problem with the Lucene Webservice or one of it's dependencies. No action is required on the part of the client.
GET (with ?query)
Request
GET /lucene/test/?query=test HTTP/1.1 Host: localhost:8080
Basic Query String Arguments
| Parameter | Description |
| query | The search query |
| limit | The desired number of search results |
| offset | Start displaying results from this offset |
| page | Start with results from this page |
| locale | Sets the Lucene locale (currently only affects date range parsing) |
| sort | Sorts the results |
Other Query String Arguments
| Parameter | Description |
| default | Default field when parsing query string |
| analyzer | Analyzer used when parsing query string |
| operator | Default operator when parsing query string (either 'AND' or 'OR') |
Response
HTTP/1.x 200 OK Content-Type: application/opensearchdescription+xml;charset=utf-8 <?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"> <opensearch:totalResults>20</opensearch:totalResults> <opensearch:startIndex>1</opensearch:startIndex> <opensearch:itemsPerPage>10</opensearch:itemsPerPage> <opensearch:link href="http://localhost:8080/lucene/test/opensearchdescription.xml" rel="search" type="application/opensearchdescription+xml"/> <opensearch:Query rel="request" searchTerms="test"/> <title>Search results for query 'test' on index 'Test Index'</title> <link href="http://localhost:8080/lucene/test/?query=temple&page=1" rel="self" type="application/atom+xml"/> <link href="http://localhost:8080/lucene/test/?query=temple&page=1" rel="first" type="application/atom+xml"/> <link href="http://localhost:8080/lucene/test/?query=temple&page=2" rel="next" type="application/atom+xml"/> <link href="http://localhost:8080/lucene/test/?query=temple&page=2" rel="last" type="application/atom+xml"/> <updated>2006-02-27T22:58:26-04:00</updated> <author> <name>Lucene Web Service</name> </author> <id>http://localhost:8080/lucene/test/?query=test</id> <entry> <title>Test Document 1</title> <link href="http://localhost:8080/lucene/test/1/" rel="alternate"/> <updated>2006-01-26T16:37:44-04:00</updated> <id>http://localhost:8080/lucene/test/1/</id> <summary>Test Document 1</summary> <opensearch:relevance>1.0</opensearch:relevance> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> <dl class="xoxo"> <dt class="stored indexed">id</dt> <dd>1</dd> <dt class="stored indexed tokenized">text</dt> <dd>Test Document 1</dd> <dt class="stored indexed">updated</dt> <dd>1138307864402</dd> </dl> </div> </content> </entry> ( ... ) </feed>
Errors
400 Bad Request (ParseException)
The query provided was malformed in some way. Clients should not perform this query until some modification has occurred.
400 Bad Request (InsufficientDataException)
One or more require elements was not provided.
404 Not Found
The index does not exist. Clients should not attempt another request for this URL.
500 Internal Server Error
There was a problem with the Lucene Webservice or one of it's dependencies. No action is required on the part of the client.
