You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by ni...@apache.org on 2003/09/17 17:01:22 UTC

cvs commit: xml-forrest/src/scratchpad/src/java/org/apache/forrest/search ForrestSearcher.java

nicolaken    2003/09/17 08:01:22

  Modified:    src/scratchpad/src/java/org/apache/forrest/search
                        ForrestSearcher.java
  Log:
  Removed JDK1.4 dependency by using an equivalent method in
  Commons Lang.
  Thanks to Ken Coar for reporting this.
  
  Revision  Changes    Path
  1.3       +4 -5      xml-forrest/src/scratchpad/src/java/org/apache/forrest/search/ForrestSearcher.java
  
  Index: ForrestSearcher.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/scratchpad/src/java/org/apache/forrest/search/ForrestSearcher.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ForrestSearcher.java	13 Sep 2003 01:21:39 -0000	1.2
  +++ ForrestSearcher.java	17 Sep 2003 15:01:22 -0000	1.3
  @@ -63,13 +63,12 @@
   
   import java.util.Date;
   
  -import org.apache.lucene.analysis.Analyzer;
  +import org.apache.commons.lang.StringUtils;
   
  +import org.apache.lucene.analysis.Analyzer;
   import org.apache.lucene.analysis.standard.StandardAnalyzer;
  -
   import org.apache.lucene.queryParser.ParseException;
   import org.apache.lucene.queryParser.QueryParser;
  -
   import org.apache.lucene.search.Hits;
   import org.apache.lucene.search.IndexSearcher;
   import org.apache.lucene.search.Query;
  @@ -178,7 +177,7 @@
               String title = hits.doc(i).get("title");
               String summary = hits.doc(i).get("summary");
               String authors = hits.doc(i).get("author");
  -            String path = hits.doc(i).get("path").replaceAll(".xml", ".html");
  +            String path = StringUtils.replace(hits.doc(i).get("path"),".xml", ".html");
               float score = hits.score(i);
               Date modified = new Date(new Long(hits.doc(i).get("modified")).
                                        longValue());