Lucene-overview

提供:Dev Guides
移動先:案内検索

Lucene-概要

Luceneは、シンプルでありながら強力なJavaベースの Search ライブラリです。 任意のアプリケーションで使用して、検索機能を追加できます。 Luceneはオープンソースプロジェクトです。 スケーラブルです。 この高性能ライブラリは、実質的にあらゆる種類のテキストのインデックス作成と検索に使用されます。 Luceneライブラリは、検索アプリケーションで必要なコア操作を提供します。 インデックス作成と検索。

検索アプリケーションの仕組み

検索アプリケーションは、次の操作のすべてまたはいくつかを実行します-

Step Title Description
1 Acquire Raw Content The first step of any search application is to collect the target contents on which search application is to be conducted.
2 Build the document The next step is to build the document(s) from the raw content, which the search application can understand and interpret easily.
3 Analyze the document Before the indexing process starts, the document is to be analyzed as to which part of the text is a candidate to be indexed. This process is where the document is analyzed.
4 Indexing the document Once documents are built and analyzed, the next step is to index them so that this document can be retrieved based on certain keys instead of the entire content of the document. Indexing process is similar to indexes at the end of a book where common words are shown with their page numbers so that these words can be tracked quickly instead of searching the complete book.
5 *User Interface for Search * Once a database of indexes is ready then the application can make any search. To facilitate a user to make a search, the application must provide a user* a mean or a user interface* where a user can enter text and start the search process.
6 Build Query Once a user makes a request to search a text, the application should prepare a Query object using that text which can be used to inquire index database to get the relevant details.
7 Search Query Using a query object, the index database is then checked to get the relevant details and the content documents.
8 Render Results Once the result is received, the application should decide on how to show the results to the user using User Interface. How much information is to be shown at first look and so on.

これらの基本的な操作とは別に、検索アプリケーションは*管理ユーザーインターフェイス*を提供し、アプリケーションの管理者がユーザープロファイルに基づいて検索レベルを制御できるようにします。 検索結果の分析は、検索アプリケーションのもう1つの重要かつ高度な側面です。

検索アプリケーションでのLuceneの役割

Luceneは、上記のステップ2からステップ7で役割を果たし、必要な操作を行うためのクラスを提供します。 一言で言えば、Luceneは検索アプリケーションの中心であり、インデックス作成と検索に関する重要な操作を提供します。 コンテンツの取得と結果の表示は、アプリケーションパーツが処理するために残されています。

次の章では、Lucene Searchライブラリを使用して簡単な検索アプリケーションを実行します。