Added a flag for wildcard case-insensitivity.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150863 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kelvin Tan 2002-12-03 11:47:26 +00:00
parent 1f66680c18
commit 1843c58c5c
1 changed files with 16 additions and 7 deletions

View File

@ -1,12 +1,13 @@
//
// JavaScript Lucene Query Validator
// Author: Kelvin Tan (kelvin@relevanz.com)
// Date: 10/04/2002
// Date: 03/12/2002
// JavaScript Lucene Query Validator
// Version: $Id$
// validates a lucene query.
// @param Form field that contains the query
function doCheckLuceneQuery(queryField)
{
var wildcardCaseInsensitive = true;
var query = queryField.value;
if(query != null && query.length > 0)
{
@ -55,6 +56,14 @@ function doCheckLuceneQuery(queryField)
return false;
}
if(wildcardCaseInsensitive)
{
if(query.indexOf("*") != -1)
{
queryField.value = query.toLowerCase();
}
}
return true;
}
}