From 5b517c34acde2f10bdb8c68e2b3bc6ba5d49e5cd Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Mon, 9 Feb 2015 17:07:39 +0000 Subject: [PATCH] LUCENE-6224: cut over more package.htmls git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1658467 13f79535-47bb-0310-9956-ffa450edef68 --- .../queryparser/analyzing/package-info.java | 22 ++ .../lucene/queryparser/analyzing/package.html | 22 -- .../queryparser/classic/package-info.java | 305 +++++++++++++++++ .../lucene/queryparser/classic/package.html | 312 ------------------ .../complexPhrase/package-info.java | 22 ++ .../queryparser/complexPhrase/package.html | 22 -- .../lucene/queryparser/ext/package-info.java | 22 ++ .../lucene/queryparser/ext/package.html | 22 -- .../flexible/core/builders/package-info.java | 32 ++ .../flexible/core/builders/package.html | 39 --- .../flexible/core/config/package-info.java | 35 ++ .../flexible/core/config/package.html | 43 --- .../flexible/core/messages/package-info.java | 26 ++ .../flexible/core/messages/package.html | 31 -- .../flexible/core/nodes/package-info.java | 78 +++++ .../flexible/core/nodes/package.html | 90 ----- .../flexible/core/package-info.java | 48 +++ .../queryparser/flexible/core/package.html | 59 ---- .../flexible/core/parser/package-info.java | 34 ++ .../flexible/core/parser/package.html | 44 --- .../core/processors/package-info.java | 45 +++ .../flexible/core/processors/package.html | 57 ---- .../flexible/core/util/package-info.java | 25 ++ .../flexible/core/util/package.html | 29 -- .../flexible/messages/package-info.java | 90 +++++ .../flexible/messages/package.html | 99 ------ .../flexible/precedence/package-info.java | 32 ++ .../flexible/precedence/package.html | 39 --- .../standard/builders/package-info.java | 31 ++ .../flexible/standard/builders/package.html | 37 --- .../standard/config/package-info.java | 30 ++ .../flexible/standard/config/package.html | 36 -- .../flexible/standard/nodes/package-info.java | 28 ++ .../flexible/standard/nodes/package.html | 33 -- .../flexible/standard/package-info.java | 35 ++ .../flexible/standard/package.html | 43 --- .../standard/parser/package-info.java | 27 ++ .../flexible/standard/parser/package.html | 35 -- .../standard/processors/package-info.java | 29 ++ .../flexible/standard/processors/package.html | 35 -- .../queryparser/simple/package-info.java | 21 ++ .../lucene/queryparser/simple/package.html | 22 -- .../surround/parser/package-info.java | 25 ++ .../queryparser/surround/parser/package.html | 28 -- .../surround/query/package-info.java | 29 ++ .../queryparser/surround/query/package.html | 32 -- .../xml/builders/package-info.java | 22 ++ .../queryparser/xml/builders/package.html | 22 -- .../lucene/queryparser/xml/package-info.java | 22 ++ .../lucene/queryparser/xml/package.html | 22 -- 50 files changed, 1115 insertions(+), 1253 deletions(-) create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/parser/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/parser/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/precedence/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/precedence/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/package.html create mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/package-info.java delete mode 100644 lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/package.html diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/package-info.java new file mode 100644 index 00000000000..77397b45cbf --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/package-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ + +/** + * QueryParser that passes Fuzzy-, Prefix-, Range-, and WildcardQuerys through the given analyzer. + */ +package org.apache.lucene.queryparser.analyzing; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/package.html deleted file mode 100644 index 2785a6bee18..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/package.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - -QueryParser that passes Fuzzy-, Prefix-, Range-, and WildcardQuerys through the given analyzer. - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package-info.java new file mode 100644 index 00000000000..ab3451f65b0 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package-info.java @@ -0,0 +1,305 @@ +/* + * 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. + */ + + +/** + * A simple query parser implemented with JavaCC. + * + *

Note that JavaCC defines lots of public classes, methods and fields + * that do not need to be public.  These clutter the documentation.  + * Sorry. + *

Note that because JavaCC defines a class named Token, org.apache.lucene.analysis.Token + * must always be fully qualified in source code in this package. + * + *

NOTE: {@link org.apache.lucene.queryparser.flexible.standard} has an alternative queryparser that matches the syntax of this one, but is more modular, + * enabling substantial customization to how a query is created. + * + *

Query Parser Syntax

+ * + *
+ * + *
+ * + * + *

Overview

+ *
+ *

Although Lucene provides the ability to create your own + * queries through its API, it also provides a rich query + * language through the Query Parser, a lexer which + * interprets a string into a Lucene Query using JavaCC. + *

Generally, the query parser syntax may change from + * release to release. This page describes the syntax as of + * the current release. If you are using a different + * version of Lucene, please consult the copy of + * docs/queryparsersyntax.html that was distributed + * with the version you are using. + *

+ * Before choosing to use the provided Query Parser, please consider the following: + *

    + * + *
  1. If you are programmatically generating a query string and then + * parsing it with the query parser then you should seriously consider building + * your queries directly with the query API. In other words, the query + * parser is designed for human-entered text, not for program-generated + * text.
  2. + * + * + *
  3. Untokenized fields are best added directly to queries, and not + * through the query parser. If a field's values are generated programmatically + * by the application, then so should query clauses for this field. + * An analyzer, which the query parser uses, is designed to convert human-entered + * text to terms. Program-generated values, like dates, keywords, etc., + * should be consistently program-generated.
  4. + * + * + *
  5. In a query form, fields which are general text should use the query + * parser. All others, such as date ranges, keywords, etc. are better added + * directly through the query API. A field with a limit set of values, + * that can be specified with a pull-down menu should not be added to a + * query string which is subsequently parsed, but rather added as a + * TermQuery clause.
  6. + * + *
+ * + *
+ * + * + * + *

Terms

+ *
+ *

A query is broken up into terms and operators. There are two types of terms: Single Terms and Phrases. + *

A Single Term is a single word such as "test" or "hello". + *

A Phrase is a group of words surrounded by double quotes such as "hello dolly". + *

Multiple terms can be combined together with Boolean operators to form a more complex query (see below). + *

Note: The analyzer used to create the index will be used on the terms and phrases in the query string. + * So it is important to choose an analyzer that will not interfere with the terms used in the query string. + *

+ * + * + * + *

Fields

+ *
+ *

Lucene supports fielded data. When performing a search you can either specify a field, or use the default field. The field names and default field is implementation specific. + *

You can search any field by typing the field name followed by a colon ":" and then the term you are looking for. + *

As an example, let's assume a Lucene index contains two fields, title and text and text is the default field. + * If you want to find the document entitled "The Right Way" which contains the text "don't go this way", you can enter: + *

title:"The Right Way" AND text:go
+ *

or + *

title:"The Right Way" AND go
+ *

Since text is the default field, the field indicator is not required. + *

Note: The field is only valid for the term that it directly precedes, so the query + *

title:The Right Way
+ *

Will only find "The" in the title field. It will find "Right" and "Way" in the default field (in this case the text field). + *

+ * + * + * + *

Term Modifiers

+ *
+ *

Lucene supports modifying query terms to provide a wide range of searching options. + * + *

Wildcard Searches

+ *

Lucene supports single and multiple character wildcard searches within single terms + * (not within phrase queries). + *

To perform a single character wildcard search use the "?" symbol. + *

To perform a multiple character wildcard search use the "*" symbol. + *

The single character wildcard search looks for terms that match that with the single character replaced. For example, to search for "text" or "test" you can use the search: + *

te?t
+ *

Multiple character wildcard searches looks for 0 or more characters. For example, to search for test, tests or tester, you can use the search: + *

test*
+ *

You can also use the wildcard searches in the middle of a term. + *

te*t
+ *

Note: You cannot use a * or ? symbol as the first character of a search. + * + *

Regular Expression Searches

+ *

Lucene supports regular expression searches matching a pattern between forward slashes "/". The syntax may change across releases, but the current supported + * syntax is documented in the {@link org.apache.lucene.util.automaton.RegExp RegExp} class. For example to find documents containing "moat" or "boat": + * + *

/[mb]oat/
+ * + *

Fuzzy Searches

+ *

Lucene supports fuzzy searches based on Damerau-Levenshtein Distance. To do a fuzzy search use the tilde, "~", symbol at the end of a Single word Term. For example to search for a term similar in spelling to "roam" use the fuzzy search: + *

roam~
+ *

This search will find terms like foam and roams. + *

An additional (optional) parameter can specify the maximum number of edits allowed. The value is between 0 and 2, For example: + *

roam~1
+ *

The default that is used if the parameter is not given is 2 edit distances. + *

Previously, a floating point value was allowed here. This syntax is considered deprecated and will be removed in Lucene 5.0 + * + *

Proximity Searches

+ *

Lucene supports finding words are a within a specific distance away. To do a proximity search use the tilde, "~", symbol at the end of a Phrase. For example to search for a "apache" and "jakarta" within 10 words of each other in a document use the search: + *

"jakarta apache"~10
+ * + *

Range Searches

+ *

Range Queries allow one to match documents whose field(s) values + * are between the lower and upper bound specified by the Range Query. + * Range Queries can be inclusive or exclusive of the upper and lower bounds. + * Sorting is done lexicographically. + *

mod_date:[20020101 TO 20030101]
+ *

This will find documents whose mod_date fields have values between 20020101 and 20030101, inclusive. + * Note that Range Queries are not reserved for date fields. You could also use range queries with non-date fields: + *

title:{Aida TO Carmen}
+ *

This will find all documents whose titles are between Aida and Carmen, but not including Aida and Carmen. + *

Inclusive range queries are denoted by square brackets. Exclusive range queries are denoted by + * curly brackets. + * + *

Boosting a Term

+ *

Lucene provides the relevance level of matching documents based on the terms found. To boost a term use the caret, "^", symbol with a boost factor (a number) at the end of the term you are searching. The higher the boost factor, the more relevant the term will be. + *

Boosting allows you to control the relevance of a document by boosting its term. For example, if you are searching for + *

jakarta apache
+ *

and you want the term "jakarta" to be more relevant boost it using the ^ symbol along with the boost factor next to the term. + * You would type: + *

jakarta^4 apache
+ *

This will make documents with the term jakarta appear more relevant. You can also boost Phrase Terms as in the example: + *

"jakarta apache"^4 "Apache Lucene"
+ *

By default, the boost factor is 1. Although the boost factor must be positive, it can be less than 1 (e.g. 0.2) + *

+ * + * + * + * + *

Boolean Operators

+ *
+ *

Boolean operators allow terms to be combined through logic operators. + * Lucene supports AND, "+", OR, NOT and "-" as Boolean operators(Note: Boolean operators must be ALL CAPS). + * + *

OR

+ *

The OR operator is the default conjunction operator. This means that if there is no Boolean operator between two terms, the OR operator is used. + * The OR operator links two terms and finds a matching document if either of the terms exist in a document. This is equivalent to a union using sets. + * The symbol || can be used in place of the word OR. + *

To search for documents that contain either "jakarta apache" or just "jakarta" use the query: + *

"jakarta apache" jakarta
+ *

or + *

"jakarta apache" OR jakarta
+ * + *

AND

+ *

The AND operator matches documents where both terms exist anywhere in the text of a single document. + * This is equivalent to an intersection using sets. The symbol && can be used in place of the word AND. + *

To search for documents that contain "jakarta apache" and "Apache Lucene" use the query: + *

"jakarta apache" AND "Apache Lucene"
+ * + *

+

+ *

The "+" or required operator requires that the term after the "+" symbol exist somewhere in a the field of a single document. + *

To search for documents that must contain "jakarta" and may contain "lucene" use the query: + *

+jakarta lucene
+ * + *

NOT

+ *

The NOT operator excludes documents that contain the term after NOT. + * This is equivalent to a difference using sets. The symbol ! can be used in place of the word NOT. + *

To search for documents that contain "jakarta apache" but not "Apache Lucene" use the query: + *

"jakarta apache" NOT "Apache Lucene"
+ *

Note: The NOT operator cannot be used with just one term. For example, the following search will return no results: + *

NOT "jakarta apache"
+ * + *

-

+ *

The "-" or prohibit operator excludes documents that contain the term after the "-" symbol. + *

To search for documents that contain "jakarta apache" but not "Apache Lucene" use the query: + *

"jakarta apache" -"Apache Lucene"
+ *
+ * + * + * + *

Grouping

+ *
+ *

Lucene supports using parentheses to group clauses to form sub queries. This can be very useful if you want to control the boolean logic for a query. + *

To search for either "jakarta" or "apache" and "website" use the query: + *

(jakarta OR apache) AND website
+ *

This eliminates any confusion and makes sure you that website must exist and either term jakarta or apache may exist. + *

+ * + * + * + *

Field Grouping

+ *
+ *

Lucene supports using parentheses to group multiple clauses to a single field. + *

To search for a title that contains both the word "return" and the phrase "pink panther" use the query: + *

title:(+return +"pink panther")
+ *
+ * + * + * + *

Escaping Special Characters

+ *
+ *

Lucene supports escaping special characters that are part of the query syntax. The current list special characters are + *

+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ / + *

To escape these character use the \ before the character. For example to search for (1+1):2 use the query: + *

\(1\+1\)\:2
+ *
+ */ +package org.apache.lucene.queryparser.classic; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package.html deleted file mode 100644 index 490f6dfec28..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/package.html +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - -A simple query parser implemented with JavaCC. -

Note that JavaCC defines lots of public classes, methods and fields -that do not need to be public.  These clutter the documentation.  -Sorry. -

Note that because JavaCC defines a class named Token, org.apache.lucene.analysis.Token -must always be fully qualified in source code in this package. - -

NOTE: {@link org.apache.lucene.queryparser.flexible.standard} has an alternative queryparser that matches the syntax of this one, but is more modular, -enabling substantial customization to how a query is created. - -

Query Parser Syntax

- -
- -
- - -

Overview

-
-

Although Lucene provides the ability to create your own - queries through its API, it also provides a rich query - language through the Query Parser, a lexer which - interprets a string into a Lucene Query using JavaCC. -

-

Generally, the query parser syntax may change from - release to release. This page describes the syntax as of - the current release. If you are using a different - version of Lucene, please consult the copy of - docs/queryparsersyntax.html that was distributed - with the version you are using. -

-

- Before choosing to use the provided Query Parser, please consider the following: -

    - -
  1. If you are programmatically generating a query string and then - parsing it with the query parser then you should seriously consider building - your queries directly with the query API. In other words, the query - parser is designed for human-entered text, not for program-generated - text.
  2. - - -
  3. Untokenized fields are best added directly to queries, and not - through the query parser. If a field's values are generated programmatically - by the application, then so should query clauses for this field. - An analyzer, which the query parser uses, is designed to convert human-entered - text to terms. Program-generated values, like dates, keywords, etc., - should be consistently program-generated.
  4. - - -
  5. In a query form, fields which are general text should use the query - parser. All others, such as date ranges, keywords, etc. are better added - directly through the query API. A field with a limit set of values, - that can be specified with a pull-down menu should not be added to a - query string which is subsequently parsed, but rather added as a - TermQuery clause.
  6. - -
- -

-
- - - -

Terms

-
-

A query is broken up into terms and operators. There are two types of terms: Single Terms and Phrases.

-

A Single Term is a single word such as "test" or "hello".

-

A Phrase is a group of words surrounded by double quotes such as "hello dolly".

-

Multiple terms can be combined together with Boolean operators to form a more complex query (see below).

-

Note: The analyzer used to create the index will be used on the terms and phrases in the query string. - So it is important to choose an analyzer that will not interfere with the terms used in the query string.

-
- - - -

Fields

-
-

Lucene supports fielded data. When performing a search you can either specify a field, or use the default field. The field names and default field is implementation specific.

-

You can search any field by typing the field name followed by a colon ":" and then the term you are looking for.

-

As an example, let's assume a Lucene index contains two fields, title and text and text is the default field. - If you want to find the document entitled "The Right Way" which contains the text "don't go this way", you can enter:

-
title:"The Right Way" AND text:go
-

or

-
title:"The Right Way" AND go
-

Since text is the default field, the field indicator is not required.

-

Note: The field is only valid for the term that it directly precedes, so the query

-
title:The Right Way
-

Will only find "The" in the title field. It will find "Right" and "Way" in the default field (in this case the text field).

-
- - - -

Term Modifiers

-
-

Lucene supports modifying query terms to provide a wide range of searching options.

- -

Wildcard Searches

-

Lucene supports single and multiple character wildcard searches within single terms - (not within phrase queries).

-

To perform a single character wildcard search use the "?" symbol.

-

To perform a multiple character wildcard search use the "*" symbol.

-

The single character wildcard search looks for terms that match that with the single character replaced. For example, to search for "text" or "test" you can use the search:

-
te?t
-

Multiple character wildcard searches looks for 0 or more characters. For example, to search for test, tests or tester, you can use the search:

-
test*
-

You can also use the wildcard searches in the middle of a term.

-
te*t
-

Note: You cannot use a * or ? symbol as the first character of a search.

- -

Regular Expression Searches

-

Lucene supports regular expression searches matching a pattern between forward slashes "/". The syntax may change across releases, but the current supported -syntax is documented in the {@link org.apache.lucene.util.automaton.RegExp RegExp} class. For example to find documents containing "moat" or "boat": -

-
/[mb]oat/
- -

Fuzzy Searches

-

Lucene supports fuzzy searches based on Damerau-Levenshtein Distance. To do a fuzzy search use the tilde, "~", symbol at the end of a Single word Term. For example to search for a term similar in spelling to "roam" use the fuzzy search:

-
roam~
-

This search will find terms like foam and roams.

-

An additional (optional) parameter can specify the maximum number of edits allowed. The value is between 0 and 2, For example:

-
roam~1
-

The default that is used if the parameter is not given is 2 edit distances.

-

Previously, a floating point value was allowed here. This syntax is considered deprecated and will be removed in Lucene 5.0

- -

Proximity Searches

-

Lucene supports finding words are a within a specific distance away. To do a proximity search use the tilde, "~", symbol at the end of a Phrase. For example to search for a "apache" and "jakarta" within 10 words of each other in a document use the search:

-
"jakarta apache"~10
- -

Range Searches

-

Range Queries allow one to match documents whose field(s) values - are between the lower and upper bound specified by the Range Query. - Range Queries can be inclusive or exclusive of the upper and lower bounds. - Sorting is done lexicographically.

-
mod_date:[20020101 TO 20030101]
-

This will find documents whose mod_date fields have values between 20020101 and 20030101, inclusive. - Note that Range Queries are not reserved for date fields. You could also use range queries with non-date fields:

-
title:{Aida TO Carmen}
-

This will find all documents whose titles are between Aida and Carmen, but not including Aida and Carmen.

-

Inclusive range queries are denoted by square brackets. Exclusive range queries are denoted by - curly brackets.

- -

Boosting a Term

-

Lucene provides the relevance level of matching documents based on the terms found. To boost a term use the caret, "^", symbol with a boost factor (a number) at the end of the term you are searching. The higher the boost factor, the more relevant the term will be.

-

Boosting allows you to control the relevance of a document by boosting its term. For example, if you are searching for

-
jakarta apache
-

and you want the term "jakarta" to be more relevant boost it using the ^ symbol along with the boost factor next to the term. - You would type:

-
jakarta^4 apache
-

This will make documents with the term jakarta appear more relevant. You can also boost Phrase Terms as in the example:

-
"jakarta apache"^4 "Apache Lucene"
-

By default, the boost factor is 1. Although the boost factor must be positive, it can be less than 1 (e.g. 0.2)

-
- - - - -

Boolean Operators

-
-

Boolean operators allow terms to be combined through logic operators. - Lucene supports AND, "+", OR, NOT and "-" as Boolean operators(Note: Boolean operators must be ALL CAPS).

- -

OR

-

The OR operator is the default conjunction operator. This means that if there is no Boolean operator between two terms, the OR operator is used. - The OR operator links two terms and finds a matching document if either of the terms exist in a document. This is equivalent to a union using sets. - The symbol || can be used in place of the word OR.

-

To search for documents that contain either "jakarta apache" or just "jakarta" use the query:

-
"jakarta apache" jakarta
-

or

-
"jakarta apache" OR jakarta
- -

AND

-

The AND operator matches documents where both terms exist anywhere in the text of a single document. - This is equivalent to an intersection using sets. The symbol && can be used in place of the word AND.

-

To search for documents that contain "jakarta apache" and "Apache Lucene" use the query:

-
"jakarta apache" AND "Apache Lucene"
- -

+

-

The "+" or required operator requires that the term after the "+" symbol exist somewhere in a the field of a single document.

-

To search for documents that must contain "jakarta" and may contain "lucene" use the query:

-
+jakarta lucene
- -

NOT

-

The NOT operator excludes documents that contain the term after NOT. - This is equivalent to a difference using sets. The symbol ! can be used in place of the word NOT.

-

To search for documents that contain "jakarta apache" but not "Apache Lucene" use the query:

-
"jakarta apache" NOT "Apache Lucene"
-

Note: The NOT operator cannot be used with just one term. For example, the following search will return no results:

-
NOT "jakarta apache"
- -

-

-

The "-" or prohibit operator excludes documents that contain the term after the "-" symbol.

-

To search for documents that contain "jakarta apache" but not "Apache Lucene" use the query:

-
"jakarta apache" -"Apache Lucene"
-
- - - -

Grouping

-
-

Lucene supports using parentheses to group clauses to form sub queries. This can be very useful if you want to control the boolean logic for a query.

-

To search for either "jakarta" or "apache" and "website" use the query:

-
(jakarta OR apache) AND website
-

This eliminates any confusion and makes sure you that website must exist and either term jakarta or apache may exist.

-
- - - -

Field Grouping

-
-

Lucene supports using parentheses to group multiple clauses to a single field.

-

To search for a title that contains both the word "return" and the phrase "pink panther" use the query:

-
title:(+return +"pink panther")
-
- - - -

Escaping Special Characters

-
-

Lucene supports escaping special characters that are part of the query syntax. The current list special characters are

-

+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ /

-

To escape these character use the \ before the character. For example to search for (1+1):2 use the query:

-
\(1\+1\)\:2
-
- - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/package-info.java new file mode 100644 index 00000000000..fbe1ccec679 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/package-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ + +/** + * QueryParser which permits complex phrase query syntax eg "(john jon jonathan~) peters*" + */ +package org.apache.lucene.queryparser.complexPhrase; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/package.html deleted file mode 100644 index ade19fc0e7e..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/complexPhrase/package.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - -QueryParser which permits complex phrase query syntax eg "(john jon jonathan~) peters*" - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/package-info.java new file mode 100644 index 00000000000..a5e9000c77f --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/package-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ + +/** + * Extendable QueryParser provides a simple and flexible extension mechanism by overloading query field names. + */ +package org.apache.lucene.queryparser.ext; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/package.html deleted file mode 100644 index 13549a8e59b..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/ext/package.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - -Extendable QueryParser provides a simple and flexible extension mechanism by overloading query field names. - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/package-info.java new file mode 100644 index 00000000000..d24c915ca9e --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/package-info.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/** + * Necessary classes to implement query builders. + * + *

Query Parser Builders

+ *

+ * The package org.apache.lucene.queryParser.builders contains the interface that + * builders must implement, it also contain a utility {@link org.apache.lucene.queryparser.flexible.core.builders.QueryTreeBuilder}, which walks the tree + * and call the Builder for each node in the tree. + * Builder normally convert QueryNode Object into a Lucene Query Object, + * and normally it's a one-to-one mapping class. + * + * But other builders implementations can by written to convert QueryNode objects to other non lucene objects. + */ +package org.apache.lucene.queryparser.flexible.core.builders; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/package.html deleted file mode 100644 index f0e329fec48..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/package.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - -Necessary classes to implement query builders. - -

Query Parser Builders

-

-The package org.apache.lucene.queryParser.builders contains the interface that -builders must implement, it also contain a utility {@link org.apache.lucene.queryparser.flexible.core.builders.QueryTreeBuilder}, which walks the tree -and call the Builder for each node in the tree. -Builder normally convert QueryNode Object into a Lucene Query Object, -and normally it's a one-to-one mapping class. - -But other builders implementations can by written to convert QueryNode objects to other non lucene objects. -

-

-

- - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/package-info.java new file mode 100644 index 00000000000..f3719e984d7 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/package-info.java @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/** + * Base classes used to configure the query processing. + * + *

Query Configuration Interfaces

+ *

+ * The package org.apache.lucene.queryparser.flexible.config contains query configuration handler + * abstract class that all config handlers should extend. + *

+ * See {@link org.apache.lucene.queryparser.flexible.standard.config.StandardQueryConfigHandler} for a reference + * implementation. + *

+ * The {@link org.apache.lucene.queryparser.flexible.core.config.QueryConfigHandler} and {@link org.apache.lucene.queryparser.flexible.core.config.FieldConfig} are used in the processors to access config + * information in a flexible and independent way. + * See {@link org.apache.lucene.queryparser.flexible.standard.processors.TermRangeQueryNodeProcessor} for a + * reference implementation. + */ +package org.apache.lucene.queryparser.flexible.core.config; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/package.html deleted file mode 100644 index 56dc6b5658b..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/package.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - -Base classes used to configure the query processing. - -

Query Configuration Interfaces

-

-The package org.apache.lucene.queryparser.flexible.config contains query configuration handler -abstract class that all config handlers should extend. -

-

-See {@link org.apache.lucene.queryparser.flexible.standard.config.StandardQueryConfigHandler} for a reference -implementation. -

-

-The {@link org.apache.lucene.queryparser.flexible.core.config.QueryConfigHandler} and {@link org.apache.lucene.queryparser.flexible.core.config.FieldConfig} are used in the processors to access config -information in a flexible and independent way. -See {@link org.apache.lucene.queryparser.flexible.standard.processors.TermRangeQueryNodeProcessor} for a -reference implementation. -

- - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/package-info.java new file mode 100644 index 00000000000..75fbb21997e --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/package-info.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + +/** + * Messages usually used by query parser implementations. + * + *

Query Parser Messages

+ * + * Messages for the Flexible Query Parser, they use org.apache.lucene.messages.NLS API. + */ +package org.apache.lucene.queryparser.flexible.core.messages; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/package.html deleted file mode 100644 index 82b85f40fd9..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/messages/package.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - -Messages usually used by query parser implementations. - -

Query Parser Messages

- -Messages for the Flexible Query Parser, they use org.apache.lucene.messages.NLS API. - - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package-info.java new file mode 100644 index 00000000000..c9d55eab12c --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package-info.java @@ -0,0 +1,78 @@ +/* + * 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. + */ + +/** + * Query nodes commonly used by query parser implementations. + * + *

Query Nodes

+ *

+ * The package org.apache.lucene.queryParser.nodes contains all the basic query nodes. The interface + * that represents a query node is {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode}. + *

+ * {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode}s are used by the text parser to create a syntax tree. + * These nodes are designed to be used by UI or other text parsers. + * The default Lucene text parser is {@link org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser}, + * it implements Lucene's standard syntax. + *

+ * {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} interface should be implemented by all query nodes, + * the class {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl} implements {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} and is extended + * by all current query node implementations. + *

+ * A query node tree can be printed to the a stream, and it generates a pseudo XML representation + * with all the nodes. + *

+ *

+ * A query node tree can also generate a query string that can be parsed back by the original text parser, + * at this point only the standard lucene syntax is supported. + *

+ * Grouping nodes: + *

+ *

+ * Leaf Nodes: + *

+ *

+ * Utility Nodes: + *

+ */ +package org.apache.lucene.queryparser.flexible.core.nodes; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package.html deleted file mode 100644 index 942e08ac995..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/package.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - -Query nodes commonly used by query parser implementations. - -

Query Nodes

-

-The package org.apache.lucene.queryParser.nodes contains all the basic query nodes. The interface -that represents a query node is {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode}. -

-

-{@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode}s are used by the text parser to create a syntax tree. -These nodes are designed to be used by UI or other text parsers. -The default Lucene text parser is {@link org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser}, -it implements Lucene's standard syntax. -

-

-{@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} interface should be implemented by all query nodes, -the class {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNodeImpl} implements {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} and is extended -by all current query node implementations. -

-

-A query node tree can be printed to the a stream, and it generates a pseudo XML representation -with all the nodes. -

-

-A query node tree can also generate a query string that can be parsed back by the original text parser, -at this point only the standard lucene syntax is supported. -

-

-Grouping nodes: -

-

-

-Leaf Nodes: -

-

-

-Utility Nodes: -

-

- - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/package-info.java new file mode 100644 index 00000000000..dd8c4cd63ca --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/package-info.java @@ -0,0 +1,48 @@ +/* + * 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. + */ + +/** + * Core classes of the flexible query parser framework. + * + *

Flexible Query Parser

+ * + *

+ * This package contains the necessary classes to implement a query parser. + * + *

+ * A query parser is divided in at least 2 phases, text parsing and query building, and one optional phase called query processing. + * + *

First Phase: Text Parsing

+ *

+ * The text parsing phase is performed by a text parser, which implements {@link org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser} interface. + * A text parser is responsible to get a query string and convert it to a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree, + * which is an object structure that represents the elements defined in the query string. + * + *

Second (optional) Phase: Query Processing

+ *

+ * The query processing phase is performed by a query processor, which implements {@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor}. + * A query processor is responsible to perform any processing on a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. This phase + * is optional and is used only if an extra processing, validation, query expansion, etc needs to be performed in a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. + * The {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree can be either be generated by a text parser or programmatically created. + * + *

Third Phase: Query Building

+ *

+ * The query building phase is performed by a query builder, which implements {@link org.apache.lucene.queryparser.flexible.core.builders.QueryBuilder}. + * A query builder is responsible to convert a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree into an arbitrary object, which + * is usually used to be executed against a search index. + */ +package org.apache.lucene.queryparser.flexible.core; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/package.html deleted file mode 100644 index e7fc0df51ff..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/package.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - -Core classes of the flexible query parser framework. - -

Flexible Query Parser

- -

-This package contains the necessary classes to implement a query parser. -

- -

-A query parser is divided in at least 2 phases, text parsing and query building, and one optional phase called query processing. -

- -

First Phase: Text Parsing

-

-The text parsing phase is performed by a text parser, which implements {@link org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser} interface. -A text parser is responsible to get a query string and convert it to a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree, -which is an object structure that represents the elements defined in the query string. -

- -

Second (optional) Phase: Query Processing

-

-The query processing phase is performed by a query processor, which implements {@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor}. -A query processor is responsible to perform any processing on a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. This phase -is optional and is used only if an extra processing, validation, query expansion, etc needs to be performed in a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. -The {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree can be either be generated by a text parser or programmatically created. -

- -

Third Phase: Query Building

-

-The query building phase is performed by a query builder, which implements {@link org.apache.lucene.queryparser.flexible.core.builders.QueryBuilder}. -A query builder is responsible to convert a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree into an arbitrary object, which -is usually used to be executed against a search index. -

- - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/parser/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/parser/package-info.java new file mode 100644 index 00000000000..273138d8762 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/parser/package-info.java @@ -0,0 +1,34 @@ +/* + * 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. + */ + +/** + * Necessary interfaces to implement text parsers. + * + *

Parser

+ *

+ * The package org.apache.lucene.queryparser.flexible.parser contains interfaces + * that should be implemented by the parsers. + * + * Parsers produce QueryNode Trees from a string object. + * These package still needs some work to add support to for multiple parsers. + * + * Features that should be supported for the future, related with the parser: + * - QueryNode tree should be able convertible to any parser syntax. + * - The query syntax should support calling other parsers. + * - QueryNode tree created by multiple parsers. + */ +package org.apache.lucene.queryparser.flexible.core.parser; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/parser/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/parser/package.html deleted file mode 100644 index 1baeb3131e6..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/parser/package.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - -Necessary interfaces to implement text parsers. - -

Parser

-

-The package org.apache.lucene.queryparser.flexible.parser contains interfaces -that should be implemented by the parsers. - -Parsers produce QueryNode Trees from a string object. -These package still needs some work to add support to for multiple parsers. - -Features that should be supported for the future, related with the parser: -- QueryNode tree should be able convertible to any parser syntax. -- The query syntax should support calling other parsers. -- QueryNode tree created by multiple parsers. - -

-

- -

- - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/package-info.java new file mode 100644 index 00000000000..86ce57b5d99 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/package-info.java @@ -0,0 +1,45 @@ +/* + * 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. + */ + +/** + * Interfaces and implementations used by query node processors + * + *

Query Node Processors

+ *

+ * The package org.apache.lucene.queryParser.processors contains interfaces + * that should be implemented by every query node processor. + *

+ * The interface that every query node processor should implement is {@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor}. + * A query node processor should be used to process a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. + * {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} trees can be programmatically created or generated by a + * text parser. See {@link org.apache.lucene.queryparser.flexible.core.parser} for more details about text parsers. + * + *

+ * A query node processor should be used to process a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. + * {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} trees can be programmatically created or generated by a + * text parser. See {@link org.apache.lucene.queryparser.flexible.core.parser} for more details about text parsers. + * + *

+ * A pipeline of processors can be assembled using {@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline}. + * + *

+ * Implementors may want to extend {@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl}, which simplifies + * the implementation, because it walks automatically the {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode}. See + * {@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl} for more details. + */ +package org.apache.lucene.queryparser.flexible.core.processors; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/package.html deleted file mode 100644 index 67fe9732334..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/package.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - -Interfaces and implementations used by query node processors - -

Query Node Processors

-

-The package org.apache.lucene.queryParser.processors contains interfaces -that should be implemented by every query node processor. -

-

-The interface that every query node processor should implement is {@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessor}. -

-

-A query node processor should be used to process a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. -{@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} trees can be programmatically created or generated by a -text parser. See {@link org.apache.lucene.queryparser.flexible.core.parser} for more details about text parsers. -

- -

-A query node processor should be used to process a {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} tree. -{@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode} trees can be programmatically created or generated by a -text parser. See {@link org.apache.lucene.queryparser.flexible.core.parser} for more details about text parsers. -

- -

-A pipeline of processors can be assembled using {@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorPipeline}. -

- -

-Implementors may want to extend {@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl}, which simplifies -the implementation, because it walks automatically the {@link org.apache.lucene.queryparser.flexible.core.nodes.QueryNode}. See -{@link org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl} for more details. -

- - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/package-info.java new file mode 100644 index 00000000000..d5f8e5b16e1 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/package-info.java @@ -0,0 +1,25 @@ +/* + * 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. + */ + +/** + * Utility classes to used with the Query Parser. + *

Utility classes to used with the Query Parser

+ *

+ * This package contains utility classes used with the query parsers. + */ +package org.apache.lucene.queryparser.flexible.core.util; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/package.html deleted file mode 100644 index 01d0a5a933e..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - -Utility classes to used with the Query Parser. -

Utility classes to used with the Query Parser

-

-This package contains utility classes used with the query parsers. -

- - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package-info.java new file mode 100644 index 00000000000..07cef021112 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package-info.java @@ -0,0 +1,90 @@ +/* + * 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. + */ + +/** + * For Native Language Support (NLS), system of software internationalization. + * + *

NLS message API

+ *

+ * This utility API, adds support for NLS messages in the apache code. + * It is currently used by the lucene "New Flexible Query PArser". + *

+ * Features: + *

    + *
  1. Message reference in the code, using static Strings
  2. + *
  3. Message resource validation at class load time, for easier debugging
  4. + *
  5. Allows for message IDs to be re-factored using eclipse or other code re-factor tools
  6. + *
  7. Allows for reference count on messages, just like code
  8. + *
  9. Lazy loading of Message Strings
  10. + *
  11. Normal loading Message Strings
  12. + *
+ * + *
+ *
+ *

+ * Lazy loading of Message Strings + * + *

+ *   public class MessagesTestBundle extends NLS {
+ *   
+ *     private static final String BUNDLE_NAME = MessagesTestBundle.class.getName();
+ *   
+ *     private MessagesTestBundle() {
+ *       // should never be instantiated
+ *     }
+ *   
+ *     static {
+ *       // register all string ids with NLS class and initialize static string
+ *       // values
+ *       NLS.initializeMessages(BUNDLE_NAME, MessagesTestBundle.class);
+ *     }
+ *   
+ *     // static string must match the strings in the property files.
+ *     public static String Q0001E_INVALID_SYNTAX;
+ *     public static String Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION;
+ *   
+ *     // this message is missing from the properties file
+ *     public static String Q0005E_MESSAGE_NOT_IN_BUNDLE;
+ *   }
+ * 
+ *     // Create a message reference
+ *     Message invalidSyntax = new MessageImpl(MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");
+ *     
+ *     // Do other stuff in the code...
+ *     // when is time to display the message to the user or log the message on a file
+ *     // the message is loaded from the correct bundle
+ *     
+ *     String message1 = invalidSyntax.getLocalizedMessage();
+ *     String message2 = invalidSyntax.getLocalizedMessage(Locale.JAPANESE);
+ * 
+ * + *
+ *
+ *

+ * Normal loading of Message Strings + * + *

+ *   String message1 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION);
+ *   String message2 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, Locale.JAPANESE);
+ * 
+ * + *

+ * The org.apache.lucene.messages.TestNLS junit contains several other examples. + * The TestNLS java code is available from the Apache Lucene code repository. + */ +package org.apache.lucene.queryparser.flexible.messages; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package.html deleted file mode 100644 index 24d41716497..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/package.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - -For Native Language Support (NLS), system of software internationalization. - -

NLS message API

-

-This utility API, adds support for NLS messages in the apache code. -It is currently used by the lucene "New Flexible Query PArser". -

-

-Features: -

    -
  1. Message reference in the code, using static Strings
  2. -
  3. Message resource validation at class load time, for easier debugging
  4. -
  5. Allows for message IDs to be re-factored using eclipse or other code re-factor tools
  6. -
  7. Allows for reference count on messages, just like code
  8. -
  9. Lazy loading of Message Strings
  10. -
  11. Normal loading Message Strings
  12. -
-

- -
-
-

-Lazy loading of Message Strings - -

-	public class MessagesTestBundle extends NLS {
-	
-	  private static final String BUNDLE_NAME = MessagesTestBundle.class.getName();
-	
-	  private MessagesTestBundle() {
-	    // should never be instantiated
-	  }
-	
-	  static {
-	    // register all string ids with NLS class and initialize static string
-	    // values
-	    NLS.initializeMessages(BUNDLE_NAME, MessagesTestBundle.class);
-	  }
-	
-	  // static string must match the strings in the property files.
-	  public static String Q0001E_INVALID_SYNTAX;
-	  public static String Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION;
-	
-	  // this message is missing from the properties file
-	  public static String Q0005E_MESSAGE_NOT_IN_BUNDLE;
-	}
-
-    // Create a message reference
-    Message invalidSyntax = new MessageImpl(MessagesTestBundle.Q0001E_INVALID_SYNTAX, "XXX");
-    
-    // Do other stuff in the code...
-    // when is time to display the message to the user or log the message on a file
-    // the message is loaded from the correct bundle
-    
-    String message1 = invalidSyntax.getLocalizedMessage();
-    String message2 = invalidSyntax.getLocalizedMessage(Locale.JAPANESE);
-
-

- -
-
-

-Normal loading of Message Strings - -

-	String message1 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION);
-	String message2 = NLS.getLocalizedMessage(MessagesTestBundle.Q0004E_INVALID_SYNTAX_ESCAPE_UNICODE_TRUNCATION, Locale.JAPANESE);
-
-

- -

-The org.apache.lucene.messages.TestNLS junit contains several other examples. -The TestNLS java code is available from the Apache Lucene code repository. -

- - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/precedence/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/precedence/package-info.java new file mode 100644 index 00000000000..2d46676ec12 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/precedence/package-info.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/** + * Precedence Query Parser Implementation + * + *

Lucene Precedence Query Parser

+ * + *

+ * The Precedence Query Parser extends the Standard Query Parser and enables + * the boolean precedence. So, the query <a AND b OR c AND d> is parsed to + * <(+a +b) (+c +d)> instead of <+a +b +c +d>. + *

+ * Check {@link org.apache.lucene.queryparser.flexible.standard.StandardQueryParser} for more details about the + * supported syntax and query parser functionalities. + */ +package org.apache.lucene.queryparser.flexible.precedence; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/precedence/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/precedence/package.html deleted file mode 100644 index 784aa6cc86f..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/precedence/package.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - -Precedence Query Parser Implementation - -

Lucene Precedence Query Parser

- -

-The Precedence Query Parser extends the Standard Query Parser and enables -the boolean precedence. So, the query <a AND b OR c AND d> is parsed to -<(+a +b) (+c +d)> instead of <+a +b +c +d>. -

-

-Check {@link org.apache.lucene.queryparser.flexible.standard.StandardQueryParser} for more details about the -supported syntax and query parser functionalities. -

- - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/package-info.java new file mode 100644 index 00000000000..2d950107da5 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/package-info.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + +/** + * Standard Lucene Query Node Builders. + * + *

Standard Lucene Query Node Builders

+ *

+ * The package org.apache.lucene.queryparser.flexible.standard.builders contains all the builders needed + * to build a Lucene Query object from a query node tree. These builders expect the query node tree was + * already processed by the {@link org.apache.lucene.queryparser.flexible.standard.processors.StandardQueryNodeProcessorPipeline}. + *

+ * {@link org.apache.lucene.queryparser.flexible.standard.builders.StandardQueryTreeBuilder} is a builder that already contains a defined map that maps each QueryNode object + * with its respective builder. + */ +package org.apache.lucene.queryparser.flexible.standard.builders; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/package.html deleted file mode 100644 index 53599e4d15b..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/builders/package.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - -Standard Lucene Query Node Builders. - -

Standard Lucene Query Node Builders

-

-The package org.apache.lucene.queryparser.flexible.standard.builders contains all the builders needed -to build a Lucene Query object from a query node tree. These builders expect the query node tree was -already processed by the {@link org.apache.lucene.queryparser.flexible.standard.processors.StandardQueryNodeProcessorPipeline}. -

-

-{@link org.apache.lucene.queryparser.flexible.standard.builders.StandardQueryTreeBuilder} is a builder that already contains a defined map that maps each QueryNode object -with its respective builder. -

- - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/package-info.java new file mode 100644 index 00000000000..6f06e796936 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/package-info.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +/** + * Standard Lucene Query Configuration. + * + *

Standard Lucene Query Configuration

+ *

+ * The package org.apache.lucene.queryparser.flexible.standard.config contains the Lucene + * query configuration handler (StandardQueryConfigHandler). This configuration + * handler reproduces almost everything that could be set on the old query parser. + *

+ * StandardQueryConfigHandler is the class that should be used to configure the StandardQueryNodeProcessorPipeline. + */ +package org.apache.lucene.queryparser.flexible.standard.config; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/package.html deleted file mode 100644 index a455c03a145..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/package.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - -Standard Lucene Query Configuration. - -

Standard Lucene Query Configuration

-

-The package org.apache.lucene.queryparser.flexible.standard.config contains the Lucene -query configuration handler (StandardQueryConfigHandler). This configuration -handler reproduces almost everything that could be set on the old query parser. -

-

-StandardQueryConfigHandler is the class that should be used to configure the StandardQueryNodeProcessorPipeline. -

- - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/package-info.java new file mode 100644 index 00000000000..0a9b75a0177 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/package-info.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + +/** + * Standard Lucene Query Nodes. + * + *

Standard Lucene Query Nodes

+ *

+ * The package org.apache.lucene.queryparser.flexible.standard.nodes contains QueryNode classes + * that are used specifically for Lucene query node tree. Any other generic QueryNode is + * defined under org.apache.lucene.queryParser.nodes. + */ +package org.apache.lucene.queryparser.flexible.standard.nodes; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/package.html deleted file mode 100644 index c8f9491977d..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/package.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - -Standard Lucene Query Nodes. - -

Standard Lucene Query Nodes

-

-The package org.apache.lucene.queryparser.flexible.standard.nodes contains QueryNode classes -that are used specifically for Lucene query node tree. Any other generic QueryNode is -defined under org.apache.lucene.queryParser.nodes. -

- - 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 new file mode 100644 index 00000000000..740ca4c2cee --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package-info.java @@ -0,0 +1,35 @@ +/* + * 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. + */ + +/** + * Implementation of the {@linkplain org.apache.lucene.queryparser.classic Lucene classic query parser} using the flexible query parser frameworks + * + *

Lucene Flexible Query Parser Implementation

+ *

+ * The old Lucene query parser used to have only one class that performed + * all the parsing 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. + * + *

+ * 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/org/apache/lucene/queryparser/flexible/standard/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package.html deleted file mode 100644 index 35f8c7cb89c..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/package.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - -Implementation of the {@linkplain org.apache.lucene.queryparser.classic Lucene classic query parser} using the flexible query parser frameworks - -

Lucene Flexible Query Parser Implementation

-

-The old Lucene query parser used to have only one class that performed -all the parsing 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. -

- -

-Check {@link org.apache.lucene.queryparser.flexible.standard.StandardQueryParser} to quick start using the Lucene query parser. -

- - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/package-info.java new file mode 100644 index 00000000000..be72e7f57a3 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/package-info.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + +/** + *

Lucene Query Parser

+ *

+ * The package org.apache.lucene.queryparser.flexible.standard.parser contains the query parser. + *

+ * This text parser only performs the syntax validation and creates an QueryNode tree + * from a query string. + */ +package org.apache.lucene.queryparser.flexible.standard.parser; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/package.html deleted file mode 100644 index 766e15f97a9..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/package.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - -Lucene Query Parser. - -

Lucene Query Parser

-

-The package org.apache.lucene.queryparser.flexible.standard.parser contains the query parser. -

-

-This text parser only performs the syntax validation and creates an QueryNode tree -from a query string. -

- - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package-info.java new file mode 100644 index 00000000000..ec68c7ef975 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package-info.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/** + * Lucene Query Node Processors. + * + *

Lucene Query Node Processors

+ *

+ * The package org.apache.lucene.queryparser.flexible.standard.processors contains every processor needed to assembly a pipeline + * that modifies the query node tree according to the actual Lucene queries. + *

+ * These processors are already assembled correctly in the StandardQueryNodeProcessorPipeline. + */ +package org.apache.lucene.queryparser.flexible.standard.processors; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package.html deleted file mode 100644 index bfa233ddf59..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/package.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - -Lucene Query Node Processors. - -

Lucene Query Node Processors

-

-The package org.apache.lucene.queryparser.flexible.standard.processors contains every processor needed to assembly a pipeline -that modifies the query node tree according to the actual Lucene queries. -

-

-These processors are already assembled correctly in the StandardQueryNodeProcessorPipeline. -

- - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/package-info.java new file mode 100644 index 00000000000..926ed1795d5 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/package-info.java @@ -0,0 +1,21 @@ +/* + * 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. + */ + +/** + * A simple query parser for human-entered queries. + */ +package org.apache.lucene.queryparser.simple; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/package.html deleted file mode 100644 index 0ea5acf8f4e..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/simple/package.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - A simple query parser for human-entered queries. - - \ No newline at end of file diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/package-info.java new file mode 100644 index 00000000000..78a8e71b794 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/package-info.java @@ -0,0 +1,25 @@ +/* + * 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. + */ + +/** + * This package contains the QueryParser.jj source file for the Surround parser. + *

+ * Parsing the text of a query results in a SrndQuery in the + * org.apache.lucene.queryparser.surround.query package. + */ +package org.apache.lucene.queryparser.surround.parser; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/package.html deleted file mode 100644 index 0d462405dca..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/package.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Surround parser package - - - This package contains the QueryParser.jj source file for the Surround parser. -

- Parsing the text of a query results in a SrndQuery in the - org.apache.lucene.queryparser.surround.query package. - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/package-info.java new file mode 100644 index 00000000000..d0c7fae8c0e --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/package-info.java @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/** + * This package contains SrndQuery and its subclasses. + *

+ * The parser in the org.apache.lucene.queryparser.surround.parser package + * normally generates a SrndQuery. + *

+ * For searching an org.apache.lucene.search.Query is provided by + * the SrndQuery.makeLuceneQueryField method. + * For this, TermQuery, BooleanQuery and SpanQuery are used from Lucene. + */ +package org.apache.lucene.queryparser.surround.query; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/package.html deleted file mode 100644 index 2dd7a03a3c9..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Surround query package - - - This package contains SrndQuery and its subclasses. -

- The parser in the org.apache.lucene.queryparser.surround.parser package - normally generates a SrndQuery. -

- For searching an org.apache.lucene.search.Query is provided by - the SrndQuery.makeLuceneQueryField method. - For this, TermQuery, BooleanQuery and SpanQuery are used from Lucene. - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/package-info.java new file mode 100644 index 00000000000..0d570fb86ae --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/package-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ + +/** + * XML Parser factories for different Lucene Query/Filters. + */ +package org.apache.lucene.queryparser.xml.builders; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/package.html deleted file mode 100644 index e39d720ae36..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/package.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - -XML Parser factories for different Lucene Query/Filters. - - diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/package-info.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/package-info.java new file mode 100644 index 00000000000..2b1abee54f3 --- /dev/null +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/package-info.java @@ -0,0 +1,22 @@ +/* + * 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. + */ + +/** + * Parser that produces Lucene Query objects from XML streams. + */ +package org.apache.lucene.queryparser.xml; + diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/package.html b/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/package.html deleted file mode 100644 index 8740ffd7a0f..00000000000 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/package.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - -Parser that produces Lucene Query objects from XML streams. - -