Camel Spring Boot

Lucene

Index messages into an Apache Lucene index and search the index with Lucene queries.

What’s inside

Please refer to the above links for usage and configuration details.

Maven coordinates

<dependency>
    <groupId>org.apache.camel.springboot</groupId>
    <artifactId>camel-lucene-starter</artifactId>
</dependency>

Spring Boot Auto-Configuration

The starter supports 8 options, which are listed below.

Name Description Default Type

camel.component.lucene.analyzer

The Lucene Analyzer that breaks text into terms: insert uses it to analyze the fields of the documents it adds, and query uses it to analyze the query text, so use the same analyzer for both. Refer to an org.apache.lucene.analysis.Analyzer bean in the registry, such as #myAnalyzer. When not set, the Lucene StandardAnalyzer is used. Set it on the endpoint: a value set on the component is not used. The option is a org.apache.lucene.analysis.Analyzer type.

Analyzer

camel.component.lucene.autowired-enabled

Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.

true

Boolean

camel.component.lucene.config

A shared configuration that each endpoint starts from. The endpoint sets all its options from its URI (an option missing in the URI gets its default), so the values set here are not used. The option is a org.apache.camel.component.lucene.LuceneConfiguration type.

LuceneConfiguration

camel.component.lucene.enabled

Whether to enable auto configuration of the lucene component. This is enabled by default.

Boolean

camel.component.lucene.index-dir

The file system directory of the Lucene index: insert writes the index there (the directory is created when missing) and query searches the index there. Refer to a java.io.File bean in the registry, such as #myIndexDir: a plain path is looked up as a bean name. When not set, the relative path file:/indexDirectory is used, that is a directory named file: in the current working directory. Set it on the endpoint: a value set on the component is not used.

File

camel.component.lucene.lazy-start-producer

Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.

false

Boolean

camel.component.lucene.max-hits

The maximum number of hits that the query operation returns, the documents with the highest score first. Must be greater than 0, otherwise each query fails. When not set, 10 hits are returned. Not used by the insert operation. Set it on the endpoint: a value set on the component is not used.

Integer

camel.component.lucene.src-dir

A directory of files that the insert operation adds to the index when the endpoint is created. Each file, also in subdirectories, is indexed as one Lucene document with the file text in the contents field and the file path in the path field; the document of a path that is already in the index is replaced. Not used by the query operation. Refer to a java.io.File bean in the registry, such as #mySourceDir: a plain path is looked up as a bean name. Set it on the endpoint: a value set on the component is not used.

File