lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject cvs commit: jakarta-lucene-sandbox/contributions/lucli/src/lucli LuceneMethods.java Lucli.java
Date Sun, 23 Jan 2005 00:11:11 GMT
dnaber      2005/01/22 16:11:11

  Modified:    contributions/lucli/src/lucli LuceneMethods.java Lucli.java
  Log:
  don't crash ony non-stored fields. small fixes to the help text.
  
  Revision  Changes    Path
  1.3       +7 -3      jakarta-lucene-sandbox/contributions/lucli/src/lucli/LuceneMethods.java
  
  Index: LuceneMethods.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/lucli/src/lucli/LuceneMethods.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LuceneMethods.java	26 Jan 2004 01:36:15 -0000	1.2
  +++ LuceneMethods.java	23 Jan 2005 00:11:11 -0000	1.3
  @@ -107,7 +107,7 @@
   
     public LuceneMethods(String index) {
       indexName = index;
  -    message("Lucene CLI. Using directory:" + indexName);
  +    message("Lucene CLI. Using directory '" + indexName + "'. Type 'help' for instructions.");
     }
   
   
  @@ -175,8 +175,12 @@
       for (int ii = 0; ii < fieldsArray.length; ii++) {
         String currField = fieldsArray[ii];
         String[] result = doc.getValues(currField);
  -      for (int i = 0; i < result.length; i++) {
  -        message(currField + ":" + result[i]);
  +      if (result != null) {
  +        for (int i = 0; i < result.length; i++) {
  +          message(currField + ":" + result[i]);
  +        }
  +      } else {
  +        message(currField + ": <not available>");
         }
       }
       //another option is to just do message(doc);
  
  
  
  1.4       +2 -2      jakarta-lucene-sandbox/contributions/lucli/src/lucli/Lucli.java
  
  Index: Lucli.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/lucli/src/lucli/Lucli.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Lucli.java	26 Jan 2004 01:36:15 -0000	1.3
  +++ Lucli.java	23 Jan 2005 00:11:11 -0000	1.4
  @@ -107,12 +107,12 @@
   		 * Initialize the list of commands
   		 */
   
  -		addCommand("info", INFO, "Display info about the current Lucene Index. Example:info");
  +		addCommand("info", INFO, "Display info about the current Lucene index. Example: info");
   		addCommand("search", SEARCH, "Search the current index. Example: search foo", 1);
   		addCommand("count", COUNT, "Return the number of hits for a search. Example: count foo",
1);
   		addCommand("optimize", OPTIMIZE, "Optimize the current index");
   		addCommand("quit", QUIT, "Quit/exit the program");
  -		addCommand("help", HELP, "Display help about commands.");
  +		addCommand("help", HELP, "Display help about commands");
   		addCommand("terms", TERMS, "Show the first " + MAX_TERMS + " terms in this index. Supply
a field name to only show terms in a specific field. Example: terms");
   		addCommand("index", INDEX, "Choose a different lucene index. Example index my_index",
1);
   		addCommand("tokens", TOKENS, "Does a search and shows the top 10 tokens for each document.
Verbose! Example: tokens foo", 1);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message