[jsword-svn] jsword/java/jsword/org/crosswire/jsword/book/search/lucene s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Wed Mar 23 20:14:31 MST 2005


Update of /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene
In directory www.crosswire.org:/tmp/cvs-serv3839/java/jsword/org/crosswire/jsword/book/search/lucene

Modified Files:
	LuceneIndex.java Msg.properties Msg.java 
Log Message:
Fixed bugs in GBFFilter and LuceneIndex.

Index: LuceneIndex.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene/LuceneIndex.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** LuceneIndex.java	23 Mar 2005 12:53:30 -0000	1.11
--- LuceneIndex.java	24 Mar 2005 03:14:29 -0000	1.12
***************
*** 5,9 ****
--- 5,11 ----
  import java.io.StringReader;
  import java.net.URL;
+ import java.util.ArrayList;
  import java.util.Iterator;
+ import java.util.List;
  
  import org.apache.lucene.analysis.Analyzer;
***************
*** 116,120 ****
                  IndexWriter writer = new IndexWriter(tempPath.getCanonicalPath(), new SimpleAnalyzer(), true);
  
!                 generateSearchIndexImpl(job, writer, book.getGlobalKeyList());
  
                  job.setProgress(95, Msg.OPTIMIZING.toString());
--- 118,123 ----
                  IndexWriter writer = new IndexWriter(tempPath.getCanonicalPath(), new SimpleAnalyzer(), true);
  
!                 List errors = new ArrayList();
!                 generateSearchIndexImpl(job, errors, writer, book.getGlobalKeyList());
  
                  job.setProgress(95, Msg.OPTIMIZING.toString());
***************
*** 133,136 ****
--- 136,151 ----
                      finalStatus = IndexStatus.DONE;
                  }
+                 if (errors.size() > 0)
+                 {
+                     StringBuffer buf = new StringBuffer();
+                     Iterator iter = errors.iterator();
+                     while (iter.hasNext())
+                     {
+                         buf.append(iter.next());
+                         buf.append('\n');
+                     }
+                     Reporter.informUser(this, Msg.BAD_VERSE, buf);                    
+                 }
+                     
              }
          }
***************
*** 243,251 ****
       * Dig down into a Key indexing as we go.
       */
!     private void generateSearchIndexImpl(Job job, IndexWriter writer, Key key) throws BookException, IOException
      {
          int bookNum = 0;
          int oldBookNum = -1;
          int percent = 0;
          for (Iterator it = key.iterator(); it.hasNext(); )
          {
--- 258,267 ----
       * Dig down into a Key indexing as we go.
       */
!     private void generateSearchIndexImpl(Job job, List errors, IndexWriter writer, Key key) throws BookException, IOException
      {
          int bookNum = 0;
          int oldBookNum = -1;
          int percent = 0;
+         String name = ""; //$NON-NLS-1$
          for (Iterator it = key.iterator(); it.hasNext(); )
          {
***************
*** 253,257 ****
              if (subkey.canHaveChildren())
              {
!                 generateSearchIndexImpl(job, writer, subkey);
              }
              else
--- 269,273 ----
              if (subkey.canHaveChildren())
              {
!                 generateSearchIndexImpl(job, errors, writer, subkey);
              }
              else
***************
*** 266,269 ****
--- 282,286 ----
                      // ignore
                      // TODO(DM): report these to the user as verses that could not be indexed.
+                     errors.add(subkey);
                      continue;
                  }
***************
*** 281,285 ****
  
                  // report progress
-                 String name = ""; //$NON-NLS-1$
                  Verse verse = KeyUtil.getVerse(subkey);
  
--- 298,301 ----

Index: Msg.properties
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene/Msg.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Msg.properties	10 Oct 2004 22:12:02 -0000	1.4
--- Msg.properties	24 Mar 2005 03:14:29 -0000	1.5
***************
*** 15,16 ****
--- 15,17 ----
  LuceneIndex.DeleteFailed=Failed to delete search index
  LuceneIndex.InstallFailed=Installation failed
+ LuceneIndex.BadVerse=The following verses have errors and could not be indexed\n{0}

Index: Msg.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene/Msg.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Msg.java	10 Oct 2004 22:12:02 -0000	1.11
--- Msg.java	24 Mar 2005 03:14:29 -0000	1.12
***************
*** 38,41 ****
--- 38,42 ----
      static final Msg DELETE_FAILED = new Msg("LuceneIndex.DeleteFailed"); //$NON-NLS-1$
      static final Msg INSTALL_FAIL = new Msg("LuceneIndex.InstallFailed"); //$NON-NLS-1$
+     static final Msg BAD_VERSE = new Msg("LuceneIndex.BadVerse"); //$NON-NLS-1$
  
      /**



More information about the jsword-svn mailing list