|
Lucene example source code file (ParametricRangeQueryNodeProcessor.java)
The Lucene ParametricRangeQueryNodeProcessor.java source codepackage org.apache.lucene.queryParser.standard.processors; /** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.text.Collator; import java.text.DateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Locale; import org.apache.lucene.document.DateField; import org.apache.lucene.document.DateTools; import org.apache.lucene.document.DateTools.Resolution; import org.apache.lucene.queryParser.core.QueryNodeException; import org.apache.lucene.queryParser.core.config.FieldConfig; import org.apache.lucene.queryParser.core.config.QueryConfigHandler; import org.apache.lucene.queryParser.core.nodes.ParametricQueryNode; import org.apache.lucene.queryParser.core.nodes.ParametricRangeQueryNode; import org.apache.lucene.queryParser.core.nodes.QueryNode; import org.apache.lucene.queryParser.core.nodes.ParametricQueryNode.CompareOperator; import org.apache.lucene.queryParser.core.processors.QueryNodeProcessorImpl; import org.apache.lucene.queryParser.standard.config.DateResolutionAttribute; import org.apache.lucene.queryParser.standard.config.LocaleAttribute; import org.apache.lucene.queryParser.standard.config.RangeCollatorAttribute; import org.apache.lucene.queryParser.standard.nodes.RangeQueryNode; /** * This processor converts {@link ParametricRangeQueryNode} objects to * {@link RangeQueryNode} objects. It reads the lower and upper bounds value * from the {@link ParametricRangeQueryNode} object and try to parse their * values using a {@link DateFormat}. If the values cannot be parsed to a date * value, it will only create the {@link RangeQueryNode} using the non-parsed * values. <br/> * <br/> * If a {@link LocaleAttribute} is defined in the {@link QueryConfigHandler} it * will be used to parse the date, otherwise {@link Locale#getDefault()} will be * used. <br/> * <br/> * If a {@link DateResolutionAttribute} is defined and the {@link Resolution} is * not <code>null it will also be used to parse the date value. Other Lucene examples (source code examples)Here is a short list of links related to this Lucene ParametricRangeQueryNodeProcessor.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.