Searcher Service

contribute the service

                    
public static void contributeSearcherService(ClassFactory classFactory,
                                            MappedConfiguration<String, Resource> configuration)
{
    Resource cpResource = new ClasspathResource(classFactory.getClassLoader(), "lucene.properties");
    configuration.add(IndexerService.CONFIG_KEY_PROPERTIES, cpResource);
}

                

configure the service

content of sample lucene.properties

                    
# folder, where lucene should store its index files
search.index.folder = ./target/lucene

# set the yout favourity stop word analyzer
# if not set, org.apache.lucene.analysis.standard.StandardAnalyzer is used
search.analyzer.class.name = org.apache.lucene.analysis.de.GermanAnalyzer

                

using the service

                    
SearcherService service = registry.getService(SearcherService.class);
Hits hits = (Hits) service.search("content", "manufacturers OR \"British Government Warehouse\"");