-
Jul 16th, 2009, 05:37 AM
#1
Lucene problem: No document handler defined for the name "test"
Hi, I have downloaded the springmodule for lucene, version 0.9 and tried to test the sample
I have used the lucene core library 2.4.1
The first problem I found is that with the initial configuration
<bean id="searcherFactory" class="org.springmodules.lucene.search.factory.Sim pleSearcherFactory">
<property name="directory" ref="fsDirectory"/>
</bean>
<!--
<bean id="searcherFactory" class="org.springmodules.lucene.search.factory.Sin gleSearcherFactory">
<property name="directory" ref="fsDirectory"/>
</bean>
-->
With SingleSearcherFactory, in the startup I have an error because there is no segment* file created and the context inizialization fails. I tried with SimpleSearcherFactory and the server starts up
I then tried to add a document
FileDocumentHolder holder = new FileDocumentHolder();
holder.setCategory("Categoria nueva");
holder.setFilename("test");
holder.setId("555");
holder.setFile(bs);
getIndexAccessorService().addDocument(holder);
and have the following exception
> indexFactory = org.springmodules.lucene.index.factory.concurrent. LockIndexFactory@40979b
> reader = org.springmodules.lucene.index.factory.SimpleLucen eIndexReader@184de18
Indice purgado
org.springmodules.lucene.index.DocumentHandlerExce ption: No document handler defined for the name test
at org.springmodules.lucene.index.document.handler.De faultDocumentHandlerManager.getDocumentHandler(Def aultDocumentHandlerManager.java:75)
at org.springmodules.lucene.index.core.InputStreamDoc umentCreatorWithManager.createDocumentFromInputStr eam(InputStreamDocumentCreatorWithManager.java:109 )
at org.springmodules.lucene.index.core.DefaultLuceneI ndexTemplate.addDocument(DefaultLuceneIndexTemplat e.java:273)
at org.springmodules.lucene.index.core.DefaultLuceneI ndexTemplate.addDocument(DefaultLuceneIndexTemplat e.java:265)
at es.xunta.cptopt.framework.lucene.dao.impl.IndexAcc essorDaoImpl.addDocument(IndexAccessorDaoImpl.java :72)
at es.xunta.cptopt.framework.lucene.service.impl.Inde xAccessorServiceImpl.addDocument(IndexAccessorServ iceImpl.java:77)
at es.xunta.cptopt.framework.webadmin.view.impl.modul es.BBModule.executeSearch(BBModule.java:184)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
I have defined my context as
<bean id="documentHandlerManager" class="org.springmodules.lucene.index.document.han dler.DocumentHandlerManagerFactoryBean">
<property name="documentHandlerManagerClass" value="org.springmodules.lucene.index.document.han dler.file.ExtensionDocumentHandlerManager"/>
<property name="documentMatchingClass" value="org.springmodules.lucene.index.document.han dler.file.ExtensionDocumentMatching"/>
</bean>
<bean id="indexAccessorDao" class="es.xunta.cptopt.framework.lucene.dao.impl.I ndexAccessorDaoImpl">
<property name="indexFactory" ref="indexFactory"/>
<property name="documentHandlerManager" ref="documentHandlerManager"/>
</bean>
<bean id="documentIdDao" class="es.xunta.cptopt.framework.lucene.dao.impl.D ocumentIdDaoImpl">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="indexAccessorService" class="es.xunta.cptopt.framework.lucene.service.im pl.IndexAccessorServiceImpl">
<property name="documentIdDao" ref="documentIdDao"/>
<property name="indexAccessorDao" ref="indexAccessorDao"/>
</bean>
Could anyone help me?
Thanks
-
Jul 17th, 2009, 03:35 AM
#2
Just a noob issue. I have tried to put "pdf" for the fieldname field and it works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules