[jsword-svn] bibledesktop/java/main/org/crosswire/bibledesktop/book s

jswordcvs at crosswire.org jswordcvs at crosswire.org
Mon May 2 19:21:25 MST 2005


Update of /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book
In directory www.crosswire.org:/tmp/cvs-serv2767/java/main/org/crosswire/bibledesktop/book

Modified Files:
	Msg.properties DisplaySelectPane.java Msg.java 
Log Message:
Added dialog for search result counts. Fixed a bug using lucene scores that were less than 0.01.

Index: DisplaySelectPane.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/DisplaySelectPane.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** DisplaySelectPane.java	2 May 2005 01:29:24 -0000	1.31
--- DisplaySelectPane.java	3 May 2005 02:21:23 -0000	1.32
***************
*** 285,288 ****
--- 285,290 ----
  
              Key results = selected.find(new DefaultSearchRequest(param, modifier));
+             int total = results.getChildCount();
+             int partial = total;
  
              // we get PassageTallys for rank searches
***************
*** 291,301 ****
                  PassageTally tally = (PassageTally) results;
                  tally.setOrdering(PassageTally.ORDER_TALLY);
!                 if (getNumRankedVerses() > 0)
                  {
!                     tally.trimRanges(getNumRankedVerses(), RestrictionType.NONE);
                  }
              }
  
!             if (results.isEmpty())
              {
                  Reporter.informUser(this, Msg.NO_HITS, new Object[] { param });
--- 293,305 ----
                  PassageTally tally = (PassageTally) results;
                  tally.setOrdering(PassageTally.ORDER_TALLY);
!                 int rankCount = getNumRankedVerses();
!                 if (rankCount > 0 && rankCount < total )
                  {
!                     tally.trimRanges(rankCount, RestrictionType.NONE);
!                     partial = rankCount;
                  }
              }
  
!             if (total == 0)
              {
                  Reporter.informUser(this, Msg.NO_HITS, new Object[] { param });
***************
*** 303,306 ****
--- 307,318 ----
              else
              {
+                 if (total == partial)
+                 {
+                     Reporter.informUser(this, Msg.HITS, new Object[] {param, new Integer(total)});
+                 }
+                 else
+                 {
+                     Reporter.informUser(this, Msg.PARTIAL_HITS, new Object[] {param, Integer.toString(partial), Integer.toString(total)});
+                 }
                  setTitle(SEARCH);
                  setKey(results);

Index: Msg.properties
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/Msg.properties,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Msg.properties	25 Apr 2005 01:22:35 -0000	1.15
--- Msg.properties	3 May 2005 02:21:23 -0000	1.16
***************
*** 25,28 ****
--- 25,30 ----
  DisplaySelectPane.Untitled=Untitled {0}
  DisplaySelectPane.NoHits=Could not find verses with: {0}
+ DisplaySelectPane.Hits=There are {1} verses with: {0}
+ DisplaySelectPane.PartialHits=Showing {1} of {2} verses with: {0}
  DisplaySelectPane.HelpTitle=Search Quick Help
  DisplaySelectPane.HelpText=<html><b>Search Tips.</b><br\>\

Index: Msg.java
===================================================================
RCS file: /cvs/jsword/bibledesktop/java/main/org/crosswire/bibledesktop/book/Msg.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Msg.java	11 Apr 2005 11:26:29 -0000	1.16
--- Msg.java	3 May 2005 02:21:23 -0000	1.17
***************
*** 49,52 ****
--- 49,54 ----
      static final Msg UNTITLED = new Msg("DisplaySelectPane.Untitled"); //$NON-NLS-1$
      static final Msg NO_HITS = new Msg("DisplaySelectPane.NoHits"); //$NON-NLS-1$
+     static final Msg HITS = new Msg("DisplaySelectPane.Hits"); //$NON-NLS-1$
+     static final Msg PARTIAL_HITS = new Msg("DisplaySelectPane.PartialHits"); //$NON-NLS-1$
      static final Msg ADVANCED_TITLE = new Msg("DisplaySelectPane.AdvancedTitle"); //$NON-NLS-1$
      static final Msg HELP_TEXT = new Msg("DisplaySelectPane.HelpText"); //$NON-NLS-1$



More information about the jsword-svn mailing list