view lucene/src/luan/modules/lucene/Lucene.luan @ 230:4438cb2e04d0

start lucene git-svn-id: https://luan-java.googlecode.com/svn/trunk@231 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Tue, 30 Sep 2014 20:03:56 +0000
parents
children 9ce18106f95a
line wrap: on
line source

import "Java"
import "luan.modules.lucene.LuceneIndex"

standard_fields = {
	"type" = "type index";
	"id" = "id index";
}

function Index(indexDir)
	local index LuceneIndex.new(indexDir).table()

	function index.save_document(doc)
		index.Writer( function(writer)
			writer.save_document(doc)
		end )
	end

	function index.delete_documents(terms)
		index.Writer( function(writer)
			writer.delete_documents(terms)
		end )
	end

	return index
end