r23675 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23674‎ | r23675 | r23676 >
Date:17:07, 3 July 2007
Author:rainman
Status:old
Tags:
Comment:
* Fix typo in SearchEngine
* Add default timestamp param to inc updater
Modified paths:
  • /trunk/lucene-search-2.0/src/org/wikimedia/lsearch/oai/IncrementalUpdater.java (modified) (history)
  • /trunk/lucene-search-2.0/src/org/wikimedia/lsearch/search/SearchEngine.java (modified) (history)

Diff [purge]

Index: trunk/lucene-search-2.0/src/org/wikimedia/lsearch/search/SearchEngine.java
@@ -167,7 +167,7 @@
168168
169169 TopDocs hits=null;
170170 // see if we can search only part of the index
171 - if(nsfw!=null && (iid.isMainPart() || iid.isNssplit())){
 171+ if(nsfw!=null && (iid.isMainsplit() || iid.isNssplit())){
172172 String part = null;
173173 for(NamespaceFilter f : nsfw.getFilter().decompose()){
174174 if(part == null)
Index: trunk/lucene-search-2.0/src/org/wikimedia/lsearch/oai/IncrementalUpdater.java
@@ -82,6 +82,7 @@
8383 boolean notification = true;
8484 HashSet<String> excludeList = new HashSet<String>();
8585 HashSet<String> firstPass = new HashSet<String>(); // if dbname is here, then it's our update pass
 86+ String defaultTimestamp = "2001-01-01";
8687 boolean fetchReferences = true;
8788 // args
8889 for(int i=0; i<args.length; i++){
@@ -91,6 +92,8 @@
9293 sleepTime = Long.parseLong(args[++i])*1000;
9394 else if(args[i].equals("-t"))
9495 timestamp = args[++i];
 96+ else if(args[i].equals("-dt"))
 97+ defaultTimestamp = args[++i];
9598 else if(args[i].equals("-f"))
9699 dblist = args[++i];
97100 else if(args[i].equals("-e"))
@@ -127,7 +130,8 @@
128131 System.out.println("Options:");
129132 System.out.println(" -d - daemonize, otherwise runs only one round of updates to dbs");
130133 System.out.println(" -s - sleep time in seconds after one cycle (default: "+sleepTime+"ms)");
131 - System.out.println(" -t - timestamp to start from (if status is missing default: "+timestamp+")");
 134+ System.out.println(" -t - timestamp to start from");
 135+ System.out.println(" -dt - default timestamp (default: "+defaultTimestamp+")");
132136 System.out.println(" -f - dblist file, one dbname per line");
133137 System.out.println(" -n - wait for notification of flush after done updating one db (default: "+notification+")");
134138 System.out.println(" -e - exclude dbname from incremental updates (overrides -f)");
@@ -171,7 +175,7 @@
172176 if(firstPass.contains(dbname) && timestamp!=null)
173177 from = timestamp;
174178 else
175 - from = status.getProperty("timestamp","2001-01-01");
 179+ from = status.getProperty("timestamp",defaultTimestamp);
176180 log.info("Resuming update of "+iid+" from "+from);
177181 ArrayList<IndexUpdateRecord> records = harvester.getRecords(from);
178182 if(records.size() == 0)

Status & tagging log