Mercurial Hosting > luan
comparison lucene/src/luan/modules/lucene/LuceneWriter.java @ 323:cd2924a1052c
improve testing
git-svn-id: https://luan-java.googlecode.com/svn/trunk@324 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Mon, 09 Feb 2015 04:33:21 +0000 |
parents | ef39bc4d3f70 |
children | 23b99a5039b5 |
comparison
equal
deleted
inserted
replaced
322:f8ece87df2b1 | 323:cd2924a1052c |
---|---|
57 return index.nextId(luan); | 57 return index.nextId(luan); |
58 } | 58 } |
59 | 59 |
60 public void save_document(LuanState luan,LuanTable doc) throws LuanException, IOException { | 60 public void save_document(LuanState luan,LuanTable doc) throws LuanException, IOException { |
61 if( doc.get("type")==null ) | 61 if( doc.get("type")==null ) |
62 throw luan.exception("missing 'type'"); | 62 throw luan.exception("missing 'type' field"); |
63 String id = (String)doc.get("id"); | 63 String id = (String)doc.get("id"); |
64 if( id == null ) { | 64 if( id == null ) { |
65 id = nextId(luan); | 65 id = nextId(luan); |
66 doc.put("id",id); | 66 doc.put("id",id); |
67 addDocument(luan,doc); | 67 addDocument(luan,doc); |