r49787 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49786‎ | r49787 | r49788 >
Date:00:45, 24 April 2009
Author:rainman
Status:deferred
Tags:
Comment:
Minor stuff:
* fix a bug with update links not being deleted
* disable funky wildcards with unpredictable execution time (e.g. a*m)
* improve logging a bit so we can actually debug stuff
Modified paths:
  • /branches/lucene-search-2.1/src/org/wikimedia/lsearch/analyzers/WikiQueryParser.java (modified) (history)
  • /branches/lucene-search-2.1/src/org/wikimedia/lsearch/interoperability/RMIMessengerClient.java (modified) (history)
  • /branches/lucene-search-2.1/src/org/wikimedia/lsearch/search/UpdateThread.java (modified) (history)

Diff [purge]

Index: branches/lucene-search-2.1/src/org/wikimedia/lsearch/interoperability/RMIMessengerClient.java
@@ -198,7 +198,7 @@
199199 recheckRemote(iid,host);
200200 HighlightPack pack = new HighlightPack(new SearchResults());
201201 pack.res.retry();
202 - log.warn("Error invoking remote method searchPart on host "+host+" : "+e.getMessage(),e);
 202+ log.warn("Error invoking searchPart("+iid+",(term="+searchterm+"),(q="+query+"),"+offset+","+limit+") on "+host+" : "+e.getMessage(),e);
203203 e.printStackTrace();
204204 return pack;
205205 }
Index: branches/lucene-search-2.1/src/org/wikimedia/lsearch/search/UpdateThread.java
@@ -139,6 +139,8 @@
140140 log.info("Syncing "+li.iid);
141141 if(!iid.isMySearch())
142142 iid.forceMySearch();
 143+ // be sure to have the latest version here
 144+ registry.refreshCurrent(iid);
143145 rebuild(li,RebuildType.STANDALONE); // rsync, update registry, cache
144146 pending.remove(li.iid.toString());
145147 }
Index: branches/lucene-search-2.1/src/org/wikimedia/lsearch/analyzers/WikiQueryParser.java
@@ -1054,6 +1054,11 @@
10551055 return false; // don't support patterns like *a*
10561056 //if(index == length-1 && buffer[index]=='?')
10571057 // return false; // probably just an ordinary question mark
 1058+
 1059+ // don't let * be in middle for performance reasons
 1060+ if(Character.isLetterOrDigit(buffer[0]) && Character.isLetterOrDigit(buffer[length-1]))
 1061+ return false;
 1062+
10581063 for(int i=0;i<length;i++){
10591064 if(Character.isLetterOrDigit(buffer[i]))
10601065 return true; // +card :P

Status & tagging log