From e8ef7a05d667d784ca9730633bcd0796942d70cb Mon Sep 17 00:00:00 2001 From: mikhail-khludnev Date: Tue, 24 Dec 2024 11:04:33 +0300 Subject: [PATCH 1/2] slightly moved description to avoid refs to absent modules --- .../queryparser/flexible/package-info.java | 76 ----------------- .../flexible/standard/package-info.java | 81 ++++++++++++++++++- lucene/queryparser/src/java/overview.html | 6 +- 3 files changed, 80 insertions(+), 83 deletions(-) diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/package-info.java index 4d20996e41bd..6bf0e5a8bf3e 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/package-info.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/package-info.java @@ -16,82 +16,6 @@ */ /** - * Flexible query parser is a modular, extensible framework for implementing Lucene query parsers. - * In the flexible query parser model, query parsing takes three steps: syntax parsing, processing - * (query semantics) and building (conversion to a Lucene {@link org.apache.lucene.search.Query}). * - *

The flexible query parser module provides not just the framework but also the {@linkplain - * org.apache.lucene.queryparser.flexible.standard.StandardQueryParser} - the default implementation - * of a fully fledged query parser that supports most of the classic query parser's syntax but also - * adds support for interval functions, min-should-match operator on Boolean groups and many hooks - * for customization of how the parser behaves at runtime. - * - *

The flexible query parser is divided in two packages: - * - *

- * - *

Features

- * - *
    - *
  1. full support for Boolean expressions, including groups - *
  2. {@linkplain org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser syntax parsers} - * - support for arbitrary syntax parsers, that can be converted into {@link - * org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} trees. - *
  3. {@linkplain org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor query - * node processors} - optimize, validate, rewrite the {@link - * org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} trees - *
  4. {@linkplain - * org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline processor - * pipelines} - select your favorite query processors and build a pipeline to implement the - * features you need. - *
  5. {@linkplain org.apache.lucene.queryparser.flexible.core.config.QueryConfigHandler query - * configuration handlers} - *
  6. {@linkplain org.apache.lucene.queryparser.flexible.core.builders.QueryBuilder query - * builders} - convert {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} - * trees into Lucene {@link org.apache.lucene.search.Query} instances. - *
- * - *

Design

- * - *

The flexible query parser was designed to have a very generic architecture, so that it can be - * easily used for different products with varying query syntax needs. - * - *

The query parser has three layers and its core is what we call the {@linkplain - * org.apache.lucene.queryparser.flexible.core.nodes.QueryNode query node tree}. It is a tree of - * objects that represent the syntax of the original query, for example, for 'a AND b' the tree - * could look like this: - * - *

- *       AND
- *      /   \
- *     A     B
- * 
- * - *

The three flexible query parser layers are: - * - *

- *
{@link org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser} - *
This layer is the text parsing layer which simply transforms the query text string into a - * {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. Every text parser - * must implement the interface {@link - * org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser}. The default - * implementation is {@link - * org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser}. - *
{@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor} - *
The query node processor does most of the work: it contains a chain of {@linkplain - * org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor query node - * processors}. Each processor can walk the tree and modify nodes or even the tree's - * structure. This allows for query optimization before the node tree is converted to an - * actual query. - *
{@link org.apache.lucene.queryparser.flexible.core.builders.QueryBuilder} - *
The third layer is a configurable map of builders, which map {@linkplain - * org.apache.lucene.queryparser.flexible.core.nodes.QueryNode query nodes} to their adapters - * that convert each node into a {@link org.apache.lucene.search.Query}. - *
*/ package org.apache.lucene.queryparser.flexible; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java index 569df7a029cf..e39fe7aae2e7 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java @@ -22,10 +22,83 @@ * operations. In the new query parser structure, the parsing was divided in 3 steps: parsing * (syntax), processing (semantic) and building. * - *

The classes contained in the package org.apache.lucene.queryParser.standard are used to - * reproduce the same behavior as the old query parser. + * Flexible query parser is a modular, extensible framework for implementing Lucene query parsers. + * In the flexible query parser model, query parsing takes three steps: syntax parsing, processing + * (query semantics) and building (conversion to a Lucene {@link org.apache.lucene.search.Query}). + * + *

The flexible query parser module provides not just the framework but also the {@linkplain + * org.apache.lucene.queryparser.flexible.standard.StandardQueryParser} - the default implementation + * of a fully fledged query parser that supports most of the classic query parser's syntax but also + * adds support for interval functions, min-should-match operator on Boolean groups and many hooks + * for customization of how the parser behaves at runtime. + * + *

The flexible query parser is divided in two packages: + * + *

+ * + *

Features

+ * + *
    + *
  1. full support for Boolean expressions, including groups + *
  2. {@linkplain org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser syntax parsers} + * - support for arbitrary syntax parsers, that can be converted into {@link + * org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} trees. + *
  3. {@linkplain org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor query + * node processors} - optimize, validate, rewrite the {@link + * org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} trees + *
  4. {@linkplain + * org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline processor + * pipelines} - select your favorite query processors and build a pipeline to implement the + * features you need. + *
  5. {@linkplain org.apache.lucene.queryparser.flexible.core.config.QueryConfigHandler query + * configuration handlers} + *
  6. {@linkplain org.apache.lucene.queryparser.flexible.core.builders.QueryBuilder query + * builders} - convert {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} + * trees into Lucene {@link org.apache.lucene.search.Query} instances. + *
+ * + *

Design

+ * + *

The flexible query parser was designed to have a very generic architecture, so that it can be + * easily used for different products with varying query syntax needs. + * + *

The query parser has three layers and its core is what we call the {@linkplain + * org.apache.lucene.queryparser.flexible.core.nodes.QueryNode query node tree}. It is a tree of + * objects that represent the syntax of the original query, for example, for 'a AND b' the tree + * could look like this: + * + *

+ *       AND
+ *      /   \
+ *     A     B
+ * 
+ * + *

The three flexible query parser layers are: + * + *

+ *
{@link org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser} + *
This layer is the text parsing layer which simply transforms the query text string into a + * {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. Every text parser + * must implement the interface {@link + * org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser}. The default + * implementation is {@link + * org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser}. + *
{@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor} + *
The query node processor does most of the work: it contains a chain of {@linkplain + * org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor query node + * processors}. Each processor can walk the tree and modify nodes or even the tree's + * structure. This allows for query optimization before the node tree is converted to an + * actual query. + *
{@link org.apache.lucene.queryparser.flexible.core.builders.QueryBuilder} + *
The third layer is a configurable map of builders, which map {@linkplain + * org.apache.lucene.queryparser.flexible.core.nodes.QueryNode query nodes} to their adapters + * that convert each node into a {@link org.apache.lucene.search.Query}. + *
* - *

Check {@link org.apache.lucene.queryparser.flexible.standard.StandardQueryParser} to quick - * start using the Lucene query parser. */ package org.apache.lucene.queryparser.flexible.standard; diff --git a/lucene/queryparser/src/java/overview.html b/lucene/queryparser/src/java/overview.html index 2b6f8a446afb..a7c579dd836f 100644 --- a/lucene/queryparser/src/java/overview.html +++ b/lucene/queryparser/src/java/overview.html @@ -27,16 +27,16 @@

Apache Lucene QueryParsers.

This module provides a number of query parsers:

- If you're new to query parsers, the {@linkplain org.apache.lucene.queryparser.flexible flexible query parser}'s + If you're new to query parsers, the {@linkplain org.apache.lucene.queryparser.flexible.standard flexible query parser}'s {@link org.apache.lucene.queryparser.flexible.standard.StandardQueryParser} is probably a good place to start. From 81dd85180f6e5b3731fb1b4515473c1ab6db1710 Mon Sep 17 00:00:00 2001 From: mikhail-khludnev Date: Tue, 24 Dec 2024 22:54:47 +0300 Subject: [PATCH 2/2] ./gradlew tidy --- .../apache/lucene/queryparser/flexible/package-info.java | 4 +--- .../queryparser/flexible/standard/package-info.java | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/package-info.java index 6bf0e5a8bf3e..f3c1ded1f1ff 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/package-info.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/package-info.java @@ -15,7 +15,5 @@ * limitations under the License. */ -/** - * - */ +/** */ package org.apache.lucene.queryparser.flexible; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java index e39fe7aae2e7..9d02e8aff020 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java @@ -22,9 +22,10 @@ * operations. In the new query parser structure, the parsing was divided in 3 steps: parsing * (syntax), processing (semantic) and building. * - * Flexible query parser is a modular, extensible framework for implementing Lucene query parsers. - * In the flexible query parser model, query parsing takes three steps: syntax parsing, processing - * (query semantics) and building (conversion to a Lucene {@link org.apache.lucene.search.Query}). + *

Flexible query parser is a modular, extensible framework for implementing Lucene query + * parsers. In the flexible query parser model, query parsing takes three steps: syntax parsing, + * processing (query semantics) and building (conversion to a Lucene {@link + * org.apache.lucene.search.Query}). * *

The flexible query parser module provides not just the framework but also the {@linkplain * org.apache.lucene.queryparser.flexible.standard.StandardQueryParser} - the default implementation @@ -99,6 +100,5 @@ * org.apache.lucene.queryparser.flexible.core.nodes.QueryNode query nodes} to their adapters * that convert each node into a {@link org.apache.lucene.search.Query}. * - * */ package org.apache.lucene.queryparser.flexible.standard;