Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Lucene problem: No document handler defined for the name "test" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    Just a noob issue. I have tried to put "pdf" for the fieldname field and it works

    Comment

    Working...
    X