985N/A * The contents of this file are subject to the terms of the 985N/A * Common Development and Distribution License (the "License"). 985N/A * You may not use this file except in compliance with the License. 985N/A * language governing permissions and limitations under the License. 985N/A * When distributing Covered Code, include this CDDL HEADER in each 985N/A * If applicable, add the following below this CDDL HEADER, with the 985N/A * fields enclosed by brackets "[]" replaced with your own identifying 985N/A * information: Portions Copyright [yyyy] [name of copyright owner] 985N/A * Copyright 2010 Sun Micosystems. All rights reserved. 985N/A * Use is subject to license terms. 985N/A * A custom query parser for OpenGrok. 985N/A * Create a query parser customized for OpenGrok. 986N/A * @param field default field for unqualified query terms 985N/A // Convert terms to lower case manually to prevent changing the case 985N/A // if the field is case sensitive. 985N/A * Is this field case sensitive? 985N/A * @param field name of the field to check 1416N/A * @return {@code true} if the field is case sensitive, {@code false} 985N/A // Only definition search and reference search are case sensitive 1416N/A * Get a canonical form of a search term. This will convert the term to 1416N/A * lower case if the field is case insensitive. 985N/A * @param field the field to search on 985N/A * @param term the term to search for 1416N/A * @return the canonical form of the search term, which matches how it is 986N/A // The analyzers use the default locale. They probably should have used 986N/A // a fixed locale, but since they don't, we ignore that PMD warning here. 985N/A // Override the get***Query() methods to lower case the search terms if 985N/A // the field is case sensitive. We don't need to override getFieldQuery() 985N/A // because it uses the analyzer to convert the terms to canonical form.