Mercurial Hosting > luan
comparison 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 |
comparison
equal
deleted
inserted
replaced
229:2a54cb7d1cf4 | 230:4438cb2e04d0 |
---|---|
1 import "Java" | |
2 import "luan.modules.lucene.LuceneIndex" | |
3 | |
4 standard_fields = { | |
5 "type" = "type index"; | |
6 "id" = "id index"; | |
7 } | |
8 | |
9 function Index(indexDir) | |
10 local index LuceneIndex.new(indexDir).table() | |
11 | |
12 function index.save_document(doc) | |
13 index.Writer( function(writer) | |
14 writer.save_document(doc) | |
15 end ) | |
16 end | |
17 | |
18 function index.delete_documents(terms) | |
19 index.Writer( function(writer) | |
20 writer.delete_documents(terms) | |
21 end ) | |
22 end | |
23 | |
24 return index | |
25 end |