comparison src/luan/modules/lucene/LuceneIndex.java @ 1673:1b9f9fdb3b41

remove backup password
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 28 May 2022 21:00:30 -0600
parents 8dd8c556c449
children af18eacf187c
comparison
equal deleted inserted replaced
1672:8dd8c556c449 1673:1b9f9fdb3b41
147 private boolean wasCreated; 147 private boolean wasCreated;
148 private final File logDir; 148 private final File logDir;
149 private final long logTime; 149 private final long logTime;
150 private final String name; 150 private final String name;
151 private final String domain; 151 private final String domain;
152 private final String password;
153 152
154 private LuceneIndex(Luan luan,File indexDir,LuanTable options) 153 private LuceneIndex(Luan luan,File indexDir,LuanTable options)
155 throws LuanException, IOException, ClassNotFoundException, SQLException 154 throws LuanException, IOException, ClassNotFoundException, SQLException
156 { 155 {
157 options = new LuanTable(options); 156 options = new LuanTable(options);
170 LuanTable module = (LuanTable)luan.require("luan:http/Http.luan"); 169 LuanTable module = (LuanTable)luan.require("luan:http/Http.luan");
171 String domain = (String)module.get(luan,"domain"); 170 String domain = (String)module.get(luan,"domain");
172 if( domain == null ) 171 if( domain == null )
173 domain = "localhost"; 172 domain = "localhost";
174 this.domain = domain; 173 this.domain = domain;
175 }
176 {
177 LuanTable module = (LuanTable)luan.require("luan:Io.luan");
178 String password = (String)module.get(luan,"password");
179 if( password == null )
180 password = "password";
181 this.password = password;
182 } 174 }
183 175
184 mfp = defaultFieldParser==null ? new MultiFieldParser() : new MultiFieldParser(defaultFieldParser,defaultFields); 176 mfp = defaultFieldParser==null ? new MultiFieldParser() : new MultiFieldParser(defaultFieldParser,defaultFields);
185 mfp.fields.put( "type", STRING_FIELD_PARSER ); 177 mfp.fields.put( "type", STRING_FIELD_PARSER );
186 mfp.fields.put( "id", NumberFieldParser.LONG ); 178 mfp.fields.put( "id", NumberFieldParser.LONG );
218 writer = new LoggingIndexWriter((LuceneIndexWriter)writer,logDir,logTime); 210 writer = new LoggingIndexWriter((LuceneIndexWriter)writer,logDir,logTime);
219 } else { 211 } else {
220 String name = this.domain; 212 String name = this.domain;
221 if( this.name != null ) 213 if( this.name != null )
222 name += "~" + this.name; 214 name += "~" + this.name;
223 writer = new BackupIndexWriter((LuceneIndexWriter)writer,logDir,logTime,name,password); 215 writer = new BackupIndexWriter((LuceneIndexWriter)writer,logDir,logTime,name);
224 //qqq 216 //qqq
225 } 217 }
226 } 218 }
227 reader = DirectoryReader.open(fsDir); 219 reader = DirectoryReader.open(fsDir);
228 searcher = new IndexSearcher(reader); 220 searcher = new IndexSearcher(reader);