Document API

GET

Performing a GET on the URL of an document will fetch an Atom Entry representing the document

Request

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

Response

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

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
	<title>Test Document 1</title>
	<link href="http://localhost:8080/lucene/test/1/" rel="alternate"/>
	<updated>2006-01-26T16:31:38-04:00</updated>
	<author>
		<name>Lucene Web Service</name>
	</author>
	<id>http://localhost:8080/lucene/test/1/</id>
	<summary>Test Document 1</summary>
	<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>1138307498752</dd>
			</dl>
		</div>
	</content>
</entry>

Errors

404 Not Found

The document 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.

PUT

Updates a document in the index. You can update multiple documents in an index by including several entry elements in a feed.

Request

PUT /lucene/test/1 HTTP/1.1
Host: localhost:8080

<?xml version="1.0" encoding="UTF-8"?>
<entry>
	<title>Update Document</title>
	<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>Updated Test Document 1</dd>
			</dl>
		</div>
	</content>
</entry>

Response

HTTP/1.x 200 OK
Location: http://localhost:8080/lucene/test/1/
Content-Type: application/atom+xml;charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
	<title>OK</title>
	<updated>2006-02-28T10:17:10-04:00</updated>
	<id>http://localhost:8080/lucene/test/1</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.

404 Not Found

The document 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.

DELETE

Deletes a document from the index.

Request

DELETE /lucene/test/1 HTTP/1.1
Host: localhost:8080

Response

HTTP/1.x 200 OK
Location: http://localhost:8080/lucene/test/1/
Content-Type: application/atom+xml;charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
	<title>OK</title>
	<updated>2006-02-28T09:35:41-04:00</updated>
	<id>http://localhost:8080/lucene/test/1</id>
	<summary>OK</summary>
</entry>

Errors

404 Not Found

The document 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.