Mercurial Hosting > luan
comparison src/luan/modules/lucene/Lucene.luan @ 1528:3bd4d7963456
use goodjava/lucene/api
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 26 Jul 2020 23:11:53 -0600 |
parents | fa1e3adbebfb |
children | fa39e3c356ae |
comparison
equal
deleted
inserted
replaced
1527:fa1e3adbebfb | 1528:3bd4d7963456 |
---|---|
38 type(index_dir)=="table" or error "index_dir must be table" | 38 type(index_dir)=="table" or error "index_dir must be table" |
39 index_dir.to_uri_string and matches(index_dir.to_uri_string(),"^file:") or error "must be file" | 39 index_dir.to_uri_string and matches(index_dir.to_uri_string(),"^file:") or error "must be file" |
40 options = options or {} | 40 options = options or {} |
41 local index = {} | 41 local index = {} |
42 index.dir = index_dir | 42 index.dir = index_dir |
43 index.completer = options.completer | 43 options.completer = nil -- remove |
44 options.completer = nil | |
45 options.supplementer = nil | |
46 local java_index = LuceneIndex.getLuceneIndex(index_dir.java.file,options) | 44 local java_index = LuceneIndex.getLuceneIndex(index_dir.java.file,options) |
47 index.java = java_index | 45 index.java = java_index |
48 | 46 |
49 index.indexed_fields = {} | 47 index.indexed_fields = {} |
50 local mt = {} | 48 local mt = {} |
60 index.snapshot = java_index.snapshot | 58 index.snapshot = java_index.snapshot |
61 index.advanced_search = java_index.advanced_search | 59 index.advanced_search = java_index.advanced_search |
62 index.search_in_transaction = java_index.search_in_transaction | 60 index.search_in_transaction = java_index.search_in_transaction |
63 index.delete_all = java_index.delete_all | 61 index.delete_all = java_index.delete_all |
64 index.delete = java_index.delete | 62 index.delete = java_index.delete |
65 --index.save = java_index.save | 63 index.save = java_index.save |
66 index.run_in_transaction = java_index.run_in_transaction | 64 index.run_in_transaction = java_index.run_in_transaction |
67 index.ensure_open = java_index.ensure_open | 65 index.ensure_open = java_index.ensure_open |
68 index.next_id = java_index.nextId | 66 index.next_id = java_index.nextId |
69 index.highlighter = java_index.highlighter | 67 index.highlighter = java_index.highlighter |
70 index.indexed_only_fields = java_index.indexed_only_fields | 68 function index.indexed_only_fields(fields) end -- remove |
71 index.count_tokens = java_index.count_tokens | 69 index.count_tokens = java_index.count_tokens |
72 --index.close = java_index.close | 70 --index.close = java_index.close |
73 | 71 |
74 local java_save = java_index.save | |
75 function index.save(doc,boosts) | |
76 java_save(index.completer,doc,boosts) | |
77 end | |
78 | |
79 index.has_postgres_backup = java_index.hasPostgresBackup() | 72 index.has_postgres_backup = java_index.hasPostgresBackup() |
80 index.rebuild_postgres_backup = java_index.rebuild_postgres_backup | 73 index.rebuild_postgres_backup = java_index.rebuild_postgres_backup |
81 function index.restore_from_postgres() | 74 index.restore_from_postgres = java_index.restore_from_postgres |
82 java_index.restore_from_postgres(index.completer) | 75 index.force_restore_from_postgres = java_index.force_restore_from_postgres |
83 end | |
84 function index.force_restore_from_postgres() | |
85 java_index.force_restore_from_postgres(index.completer) | |
86 end | |
87 index.check = java_index.check | 76 index.check = java_index.check |
88 | 77 |
89 function index.search( query, from, to, options ) | 78 function index.search( query, from, to, options ) |
90 from or error "missing 'from' parameter" | 79 from or error "missing 'from' parameter" |
91 to or error "missing 'to' parameter" | 80 to or error "missing 'to' parameter" |