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

jswordcvs at crosswire.org jswordcvs at crosswire.org
Wed Jan 26 19:18:37 MST 2005


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

Modified Files:
	LuceneIndex.java 
Log Message:
Fixed the searching to return all hits.
Problem was that it was using a Tally Passage.

Index: LuceneIndex.java
===================================================================
RCS file: /cvs/jsword/jsword/java/jsword/org/crosswire/jsword/book/search/lucene/LuceneIndex.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** LuceneIndex.java	9 Oct 2004 21:45:05 -0000	1.2
--- LuceneIndex.java	27 Jan 2005 02:18:34 -0000	1.3
***************
*** 35,39 ****
  import org.crosswire.jsword.passage.NoSuchKeyException;
  import org.crosswire.jsword.passage.NoSuchVerseException;
- import org.crosswire.jsword.passage.PassageTally;
  import org.crosswire.jsword.passage.Verse;
  import org.crosswire.jsword.passage.VerseFactory;
--- 35,38 ----
***************
*** 140,144 ****
          checkActive();
  
!         PassageTally tally = new PassageTally();
  
          if (search != null)
--- 139,144 ----
          checkActive();
  
!         Key tally = book.createEmptyKeyList();
!         // Tally tally = new PassageTally();
  
          if (search != null)
***************
*** 155,160 ****
                      {
                          Verse verse = VerseFactory.fromString(hits.doc(i).get(LuceneIndex.FIELD_NAME));
!                         int score = (int) (hits.score(i) * 100);
!                         tally.add(verse, score);
                      }
                  }
--- 155,161 ----
                      {
                          Verse verse = VerseFactory.fromString(hits.doc(i).get(LuceneIndex.FIELD_NAME));
! //                        int score = (int) (hits.score(i) * 100);
! //                        tally.add(verse, score);
!                         tally.addAll(verse);
                      }
                  }
***************
*** 243,250 ****
              {
                  BookData data = book.getData(subkey);
!                 Reader reader = new StringReader(data.getPlainText());
  
                  Document doc = new Document();
!                 doc.add(Field.Text(FIELD_NAME, subkey.getName()));
                  doc.add(Field.Text(FIELD_BODY, reader));
  
--- 244,252 ----
              {
                  BookData data = book.getData(subkey);
!                 String text = data.getPlainText();
!                 Reader reader = new StringReader(text);
  
                  Document doc = new Document();
!                 doc.add(Field.UnIndexed(FIELD_NAME, subkey.getName()));
                  doc.add(Field.Text(FIELD_BODY, reader));
  



More information about the jsword-svn mailing list