Service API

GET

Performing a GET on the base web service URL will retrieve the AtomPP Introspection Document. The document will list the indices ("collections" in the AtomPP) available. The AtomPP allows for multiple workspaces to encapsulate collections, however, for our purposes there will only ever be one workspace.

Request

GET /lucene/ HTTP/1.1
Host: localhost:8080

Response

HTTP/1.x 200 OK
Content-Type: application/atomserv+xml;charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<service xmlns="http://purl.org/atom/app#">
	<workspace title="Lucene Web Service">
		<collection href="http://localhost:8080/lucene/test/" title="Test Index">
			<member-type>entry</member-type>
		</collection>
		<collection href="http://localhost:8080/lucene/another/" title="Another Index">
			<member-type>entry</member-type>
		</collection>
	</workspace>
</service>

Errors

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.

POST

To create an index, you should POST an Atom Entry to the service URL. You can create multiple indices at once by wrapping multiple entries in an Atom Feed. The title of the entry will be used at the location of the new index. You can set some initial index properties for the index by specifying an XOXO formatted contents section (see the Index.Properties API for more information).

Request

POST /lucene/ HTTP/1.x
Host: localhost:8080
Content-Type: application/atom+xml

<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom">
	<title>new_index</title>
	<content type="xhtml">
		<div xmlns="http://www.w3.org/1999/xhtml">
			<dl class="xoxo">
				<dt>index.title</dt>
				<dd>My New Index</dd>
				<dt>index.author</dt>
				<dd>A.U. Thor</dd>
			</dl>
		</div>
	</content>
</entry>

Response

HTTP/1.x 201 Created
Location: http://localhost:8080/lucene/new_index/

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
	<title>OK</title>
	<updated>2006-02-27T22:40:42-04:00</updated>
	<id>http://localhost:8080/lucene/</id>
	<summary>OK</summary>
</entry>

Errors

400 Bad Request

The Atom Entry or Feed provided is malformed in some way. Client should not attempt the same request without some modifications.

409 Conflict

The index name already exists. Clients should not attempt to create an index under that name.

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.