Chapter 3. Aim of the support

The aim of the Lucene support is to provide facilities in order to use the tools based on Lucene in a Spring environment. The support follows the principles than those used in the Spring framework.

With the current version of the tool, only Lucene Java is supported but the supports of Solrj and Tika will be added soon in the next version. The same features are provided in the context of these tools.

3.1. Architecture and structure

TODO: describe the high level architecture of the project

TODO: describe the approach to make easy the use of Lucene technologies in Spring applications

Global architecture of the support

3.2. Abstraction layer upon Lucene

The support provides a thin layer upon the Lucene API which offers the same feature basing on interfaces. It enabled a level of indirection in order to make easier the resource management in different context and make possible unit tests of classes using Lucene. This thin layer covers both indexing and searching

With this feature, you can specify the resource management strategy declaratively in the Spring configuration according to the use context of Lucene. This aspect is supported for both indexing and searching with dedicated strategies. As a matter of fact, Lucene owns specific resources management to access indices. For instance, you can share searcher instances in order to search in a concurrent environment. However, only one instance of Lucene writer can access an index in order to update it.

3.3. Easy configuration

In addition, the support provides interesting facilities in order to configure these resources and the use strategies in a Spring environment thanks to a dedicated namespace. This configuration facility is available for both indexing and searching.

3.4. Template-driven approach

Besides this aspect, the support provides too a classic template-driven approach, this approach being currently used in the Spring integration of tools. Templates integrate all the technical plumbing management allowing you to concentrate on the specific code of your application.

The support integrate itself the declarative transaction management of Spring with dedicated implementations of PlatformTransactionManager interface related to Lucene tools. These features are based on the underlying API of these tools.

3.5. Document handler

On the other hand, the support provides a generic document handling feature in order to offer dedicated entities to create documents . This feature also manages the document and handler association. The handler has the responsibility to create a document from an object or an InputStream . The feature is particularly useful to manage the indexing of different file formats.