Index API

GET

Performing a GET on the URL of an index will (as per the AtomPP spec) return a list of the most recently modified documents. By default they are paged 10 documents at a time.

Request

GET /lucene/test/ 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"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title>My test index</title>
	<link href="http://localhost:8080/lucene/asv/" rel="self" type="application/atom+xml"/>
	<link href="http://localhost:8080/lucene/asv/?page=1" rel="first" type="application/atom+xml"/>
	<link href="http://localhost:8080/lucene/asv/?page=2" rel="next" type="application/atom+xml"/>
	<link href="http://localhost:8080/lucene/asv/?page=2" rel="last" type="application/atom+xml"/>
	<updated>2006-02-24T12:29:19-04:00</updated>
	<author>
		<name>Lucene Web Service</name>
	</author>
	<id>http://localhost:8080/lucene/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>
		<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

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.

DELETE

This method allows you to delete an index.

Request

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

Response

HTTP/1.x 200 OK
Location: http://unbstudent:8080/lucene/foo/
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-27T08:24:03-04:00</updated>
	<id>http://localhost:8080/lucene/foo</id>
	<summary>OK</summary>
</entry>

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.

POST

Allows you to add a document to the index. You can add multiple documents to an index by including several entry elements in a feed.

Request

POST /lucene/test/ HTTP/1.1
Host: localhost:8080
Content-Type: application/atom+xml;charset=utf-8

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

Response

HTTP/1.x 201 Created
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-27T22:34:32-04:00</updated>
	<id>http://localhost:8080/lucene/test/</id>
	<summary>OK</summary>
</entry>

Errors

404 Not Found

The index does not exist. Clients should not attempt another request for this URL.

409 Conflict

A document with the id specified already exists. Clients should not attempt to create a document with that id again.

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.