lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kelv...@apache.org
Subject cvs commit: jakarta-lucene-sandbox/contributions/javascript/queryValidator luceneQueryValidator.js
Date Tue, 16 Dec 2003 02:22:02 GMT
kelvint     2003/12/15 18:22:02

  Modified:    contributions/javascript/queryValidator
                        luceneQueryValidator.js
  Log:
  Fixed bug where the field in a wildcard field search was being lowercased.
  
  Revision  Changes    Path
  1.4       +11 -3     jakarta-lucene-sandbox/contributions/javascript/queryValidator/luceneQueryValidator.js
  
  Index: luceneQueryValidator.js
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene-sandbox/contributions/javascript/queryValidator/luceneQueryValidator.js,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- luceneQueryValidator.js	5 Dec 2002 00:22:50 -0000	1.3
  +++ luceneQueryValidator.js	16 Dec 2003 02:22:02 -0000	1.4
  @@ -1,9 +1,9 @@
   // Author: Kelvin Tan  (kelvin@relevanz.com)
  -// Date:   03/12/2002
   // JavaScript Lucene Query Validator
   // Version: $Id$
   
   // Makes wildcard queries case-insensitive if true.
  +// Refer to http://www.mail-archive.com/lucene-user@jakarta.apache.org/msg00646.html
   var wildcardCaseInsensitive = true;
   
   // Mutator method for wildcardCaseInsensitive.
  @@ -69,7 +69,15 @@
       {
         if(query.indexOf("*") != -1)
         {
  -        queryField.value = query.toLowerCase();
  +        var i = query.indexOf(':');
  +        if(i == -1)
  +        {
  +          queryField.value = query.toLowerCase();
  +        }
  +        else // found a wildcard field search
  +        {
  +          queryField.value = query.substring(0, i) + query.substring(i).toLowerCase();
  +        }
         }
       }
   
  
  
  

---------------------------------------------------------------------
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