Fixed bug where the field in a wildcard field search was being lowercased.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150896 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kelvin Tan 2003-12-16 02:22:02 +00:00
parent ff6a1404c4
commit 4d96f7eb97
1 changed files with 10 additions and 2 deletions

View File

@ -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 @@ function doCheckLuceneQuery(queryField)
{
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();
}
}
}