Foren

Problem in creating Custom Lucene Indexer for a new custom Entity

thumbnail
Luca Preziati, geändert vor 14 Jahren.

Problem in creating Custom Lucene Indexer for a new custom Entity

Regular Member Beiträge: 120 Beitrittsdatum: 09.02.09 Neueste Beiträge
Hi everybody,
I'm trying to develop a custom index with lucene. My indexer throw this exception when I try to create a new folder, with the code 5 for dividing the existing index.
This is the exception.

16:20:55,808 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@1f36586
com.liferay.portal.kernel.search.SearchException: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:73)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.deleteDocument(LuceneSearchEngineUtil.java:56)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:67)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:185)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:167)
at com.liferay.portal.search.lucene.IndexWriterFactory.deleteDocuments(IndexWriterFactory.java:147)
at com.liferay.portal.search.lucene.LuceneUtil.deleteDocuments(LuceneUtil.java:262)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:70)
... 8 more
16:20:55,813 ERROR [IndexWriterFactory:209] Unable to create a new writer
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:243)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:616)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:410)
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:190)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
16:20:55,818 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@109b25f
com.liferay.portal.kernel.search.SearchException: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:57)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:211)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
... 8 more
16:20:55,820 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@19da9aa
com.liferay.portal.kernel.search.SearchException: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:73)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.deleteDocument(LuceneSearchEngineUtil.java:56)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:67)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:185)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:167)
at com.liferay.portal.search.lucene.IndexWriterFactory.deleteDocuments(IndexWriterFactory.java:147)
at com.liferay.portal.search.lucene.LuceneUtil.deleteDocuments(LuceneUtil.java:262)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:70)
... 8 more
16:20:55,823 ERROR [IndexWriterFactory:209] Unable to create a new writer
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:243)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:616)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:410)
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:190)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
16:20:55,826 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@1c2ef1b
com.liferay.portal.kernel.search.SearchException: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:57)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:211)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
... 8 more
16:20:55,845 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@dfe0c6
com.liferay.portal.kernel.search.SearchException: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:73)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.deleteDocument(LuceneSearchEngineUtil.java:56)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:67)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:185)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:167)
at com.liferay.portal.search.lucene.IndexWriterFactory.deleteDocuments(IndexWriterFactory.java:147)
at com.liferay.portal.search.lucene.LuceneUtil.deleteDocuments(LuceneUtil.java:262)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:70)
... 8 more
16:20:55,848 ERROR [IndexWriterFactory:209] Unable to create a new writer
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:243)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:616)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:410)
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:190)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
16:20:55,849 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@1a13f4c
com.liferay.portal.kernel.search.SearchException: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:57)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:211)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
... 8 more
16:20:55,851 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@1429a7d
com.liferay.portal.kernel.search.SearchException: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:73)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.deleteDocument(LuceneSearchEngineUtil.java:56)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:67)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:185)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:167)
at com.liferay.portal.search.lucene.IndexWriterFactory.deleteDocuments(IndexWriterFactory.java:147)
at com.liferay.portal.search.lucene.LuceneUtil.deleteDocuments(LuceneUtil.java:262)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:70)
... 8 more
16:20:55,853 ERROR [IndexWriterFactory:209] Unable to create a new writer
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:243)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:616)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:410)
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:190)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
16:20:55,854 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@14d99bb
com.liferay.portal.kernel.search.SearchException: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:57)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:211)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
... 8 more
16:20:55,857 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@1a7cde3
com.liferay.portal.kernel.search.SearchException: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:73)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.deleteDocument(LuceneSearchEngineUtil.java:56)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:67)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:185)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:167)
at com.liferay.portal.search.lucene.IndexWriterFactory.deleteDocuments(IndexWriterFactory.java:147)
at com.liferay.portal.search.lucene.LuceneUtil.deleteDocuments(LuceneUtil.java:262)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:70)
... 8 more
16:20:55,860 ERROR [IndexWriterFactory:209] Unable to create a new writer
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:243)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:616)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:410)
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:190)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
16:20:55,861 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@153d9d2
com.liferay.portal.kernel.search.SearchException: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:57)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:211)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
... 8 more
16:20:55,863 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@173e7
com.liferay.portal.kernel.search.SearchException: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:73)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.deleteDocument(LuceneSearchEngineUtil.java:56)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:67)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:185)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:167)
at com.liferay.portal.search.lucene.IndexWriterFactory.deleteDocuments(IndexWriterFactory.java:147)
at com.liferay.portal.search.lucene.LuceneUtil.deleteDocuments(LuceneUtil.java:262)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:70)
... 8 more
16:20:55,866 ERROR [IndexWriterFactory:209] Unable to create a new writer
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:243)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:616)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:410)
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:190)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
16:20:55,868 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@255a5a
com.liferay.portal.kernel.search.SearchException: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:57)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:211)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
... 8 more
16:20:55,870 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@4ee98f
com.liferay.portal.kernel.search.SearchException: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:73)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.deleteDocument(LuceneSearchEngineUtil.java:56)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:67)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:185)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:167)
at com.liferay.portal.search.lucene.IndexWriterFactory.deleteDocuments(IndexWriterFactory.java:147)
at com.liferay.portal.search.lucene.LuceneUtil.deleteDocuments(LuceneUtil.java:262)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.deleteDocument(LuceneIndexWriterImpl.java:70)
... 8 more
16:20:55,874 ERROR [IndexWriterFactory:209] Unable to create a new writer
java.io.FileNotFoundException: no segments* file found in org.apache.lucene.store.FSDirectory@C:\srv\liferay\lucene\5: files:
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:516)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:243)
at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:616)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:410)
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:190)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
16:20:55,875 ERROR [LuceneWriterMessageListener:46] Unable to process message com.liferay.portal.kernel.search.messaging.SearchRequest@2660ad
com.liferay.portal.kernel.search.SearchException: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:57)
at com.liferay.portal.search.lucene.LuceneSearchEngineUtil.addDocument(LuceneSearchEngineUtil.java:50)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.doReceive(LuceneWriterMessageListener.java:64)
at com.liferay.portal.search.lucene.messaging.LuceneWriterMessageListener.receive(LuceneWriterMessageListener.java:43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:69)
at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:59)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Unable to create a new writer
at com.liferay.portal.search.lucene.IndexWriterFactory.getWriter(IndexWriterFactory.java:211)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:294)
at com.liferay.portal.search.lucene.LuceneUtil.getWriter(LuceneUtil.java:288)
at com.liferay.portal.search.lucene.LuceneIndexWriterImpl.addDocument(LuceneIndexWriterImpl.java:52)
... 8 more



Otherwise if I use the folder 0 no problem exist, but I found mixed my older information with my new entity information.


The indexer code is:

/**
* Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package com.ext.portlet.userExt.util;

import javax.portlet.PortletURL;

import com.ext.portlet.userExt.service.UserExtLocalServiceUtil;
import com.ext.util.ExtField;
import com.ext.util.ExtPortletKeys;
import com.liferay.portal.kernel.search.Document;
import com.liferay.portal.kernel.search.DocumentImpl;
import com.liferay.portal.kernel.search.DocumentSummary;
import com.liferay.portal.kernel.search.Field;
import com.liferay.portal.kernel.search.SearchEngineUtil;
import com.liferay.portal.kernel.search.SearchException;
import com.liferay.portal.kernel.util.StringUtil;

/**
* <a href="Indexer.java.html"><b><i>View Source</i></b></a>
*
* @author Brian Wing Shun Chan
* @author Harry Mark
* @author Bruno Farache
*
*/
public class Indexer implements com.liferay.portal.kernel.search.Indexer {

public static final String PORTLET_ID = ExtPortletKeys.EXT_USER_EXT;


/* This value set in witch folder the index is built*/
public static final Long UserExt = 5L;

public static void addUserExt(
long userExtId, long userId, String categories)
throws SearchException {

Document doc = getUserExt(userExtId, userId, categories);

SearchEngineUtil.addDocument(UserExt, doc);
}

public static void deleteUserExt(long userExtId,long userId)
throws SearchException {

SearchEngineUtil.deleteDocument(UserExt,getUserExtUID(userExtId));
}

public static Document getUserExt(
long userExtId, long userId, String categories) {

Document doc = new DocumentImpl();

doc.addUID(PORTLET_ID, userExtId);

doc.addKeyword(Field.USER_ID, userId);
doc.addKeyword(ExtField.CATEGORIES, StringUtil.split(categories));

return doc;
}

public static String getUserExtUID(long userExtId) {
Document doc = new DocumentImpl();

doc.addUID(PORTLET_ID, userExtId);

return doc.get(Field.UID);
}

public static void updateUserExt(
long userExtId, long userId, String categories)
throws SearchException {

Document doc = getUserExt(userExtId, userId, categories);

SearchEngineUtil.updateDocument(UserExt, doc.get(Field.UID), doc);
}


public void reIndex(String[] ids) throws SearchException {
try {
UserExtLocalServiceUtil.reIndex(ids);
}
catch (Exception e) {
throw new SearchException(e);
}
}

@Override
public DocumentSummary getDocumentSummary(Document arg0, PortletURL arg1) {
// TODO Auto-generated method stub
return null;
}



}
thumbnail
Luca Preziati, geändert vor 14 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Regular Member Beiträge: 120 Beitrittsdatum: 09.02.09 Neueste Beiträge
Does anybody have implemented a new lucene index?
Oliver Bayer, geändert vor 14 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
Hi,

I've implemented a new lucene indexer for the xsl content portlet but I didn't get this error. But during development I found it useful if you delete the content of the "data \ lucene" dir before server start and activate "index.on.startup=true" in portal-ext.properties. So the lucene index is always created new.

HTH
thumbnail
Luca Preziati, geändert vor 14 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Regular Member Beiträge: 120 Beitrittsdatum: 09.02.09 Neueste Beiträge
Now I'm trying. I call the reindex function from view, and this exception is always raised. I found also that if I put a segment file of another index, all work well. So I think something in creation of this file on filesystem failed, or I forget something.
Any suggestion?
thumbnail
Luca Preziati, geändert vor 14 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Regular Member Beiträge: 120 Beitrittsdatum: 09.02.09 Neueste Beiträge
I understand the problem, is related with the 5L index that I try to create. In fact liferay user the companyId to choose in what path build index, and for an optimization i try to put in another folder, separeted from other information.
I think it's a bad choose of design, bacause, why should I mix different information in the same index? For article and all other entity it's a good choice, but I think that can be more understandable separeted the folder.
Yogesh Prabhu, geändert vor 13 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Junior Member Beiträge: 26 Beitrittsdatum: 05.03.10 Neueste Beiträge
Hi Luca, Hi all..

I have created a custom struts portlet with 2-3 fields to collect metadata..
I want to search the data based on the metadata that i enter..
I have created an Indexer.java file as well as registered in liferay-portlet-ext.xml..
I am not able to understand how to make a search.jsp file..

Could you please help me with the proper steps that i need to follow..

It would be great if you could help me with a basic template of a search.jsp file and any other file that i would need in accomplishing this task..

Any kind of suggestions or ideas would be of great help..

Thanks..
Oliver Bayer, geändert vor 13 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
Hi Yogesh,

you don't have to write a search.jsp on your own. You need an Indexer class (which you've already created) and also a Search class. Both must be registered inside liferay-portlet-ext.xml.

To write a search class shouldn't be to difficult.
- create a class MyPortletOpenSearchImpl which extends from HitsOpenSearchImpl
- implement the used methods like e.g. the most important one getHits(...)
- inside getHits create a lucene query e.g.
BooleanQuery contextQuery = BooleanQueryFactoryUtil.create();
contextQuery.addRequiredTerm(Field.PORTLET_ID, YOUR_PORTLET_ID);
...
BooleanQuery searchQuery = BooleanQueryFactoryUtil.create();
searchQuery.addTerm(Field.CONTENT, keywords);
...
BooleanQuery fullQuery = BooleanQueryFactoryUtil.create();
fullQuery.add(contextQuery, BooleanClauseOccur.MUST);
fullQuery.add(searchQuery, BooleanClauseOccur.MUST);
...
return SearchEngineUtil.search(companyId, groupId, userId, "YOUR PORTLET", fullQuery, start, end);


So if you put the liferay search portlet on a page you can now search your portlet too without writing your own search.jsp.

If you have any questions feel free to ask.

HTH Oli
Yogesh Prabhu, geändert vor 13 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Junior Member Beiträge: 26 Beitrittsdatum: 05.03.10 Neueste Beiträge
Hi Oliver,

Thank you very much for your quick reply..
Ok, now atleast i am sure of the steps..but could you please explain in some more detail as to what i should include in my (..)Impl.java file..??

A sample (..)Impl file would be of great help..

Any kind of ideas and suggestions would be of great help..

Thanks in advance..
Yogesh Prabhu, geändert vor 13 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Junior Member Beiträge: 26 Beitrittsdatum: 05.03.10 Neueste Beiträge
Hi Oliver,

Sorry, but i am very confused again..emoticon although, i can see my portlet in the search results page now..but i am not getting any results..I believe its not calling the Indexer.java file. I tried putting some print statements inside it, but they were not printed..

I am sure of one thing: We need two class files i.e Indexer.java and (..)SearchImpl.java
Then we have to register these files in the liferay-portlet-ext.xml file.

Now, i believe even my Indexer.java file is wrong..emoticon

I am attaching the three files : Indexer.java and (..)SearchImpl.java and also my service.xml file for your reference

Can u please help me with this..

Thanks..!!
Oliver Bayer, geändert vor 13 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
Hi Yogesh,

it seems that your indexer isn't correct if you're using liferay v5.2.3 like me.

Your indexer class must implement the following methods:
public String[] getClassNames();
public DocumentSummary getDocumentSummary(Document doc, PortletURL portletURL);
public void reIndex(String className, long classPK) throws SearchException;
public void reIndex(String[] ids) throws SearchException;

The most important method is the last one (reIndex(String[] ids) because this one is getting called by liferay if you click reindex in controlpanel or if you set the property to reindex on startup.

In your indexer file this method doesn't do anything. But there you should create the document with the data to be searchable and pass it to the SearchEngineUtil.

Sample reIndex method:
public void reIndex(String[] ids) throws SearchException 
{
	Document doc = new DocumentImpl();
	doc.addText(Field.TITLE, PORTLET_ID);
	doc.addText(Field.CONTENT, "content string bla bla");
	doc.addKeyword(Field.GROUP_ID, "12345");
	doc.addKeyword(Field.PORTLET_ID, PORTLET_NAME);

	SearchEngineUtil.addDocument(companyId, doc);
}

You can use luke tool to check what is getting indexed in lucene.

If the indexer is working you can now create a query in searchImpl using the fields you've indexed to get search results.

Greets Oli
Yogesh Prabhu, geändert vor 13 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Junior Member Beiträge: 26 Beitrittsdatum: 05.03.10 Neueste Beiträge
Hi Oliver,

Thanks for your reply..i am following your steps of implementing those methods..

Now, when i implement the reindex method in Indexer.java file, i get an error that no such method is defined in HelpdeskEntryLocalServiceImpl.java file which is present in com.ext.portlet.helpdesk.service.impl package

Now what should i write in the reindex method in HelpdeskEntryLocalServiceImpl.java file??

Too many dependency between the files..too many java files to touch i believe..getting confusedemoticon

Any suggestion would be of great help..!!

Thanks..!!
Oliver Bayer, geändert vor 13 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
Hi,

as I wrote an indexer for the xslcontent portlet I don't have such a dependency. I only have one indexer and one opensearch class. The indexer class determines on which pages the xslcontent portlet is on and then reads the xml and xsl url from portletpreferences to get the content to index.

I don't know your portlet and how it work (how you get the data to display) but maybe you can implement it the same way:

- First determine on which pages your portlet is placed. This can be achieved by using a dynamic query for the portletpreferences table selecting only data which has your portletid in the same collumn.
- Try to get the data of your portlet and save it into lucene.

As a first easier step you can write a static indexer that means put all values directly in source-code. If the indexer and the opensearchimpl are working you can try to get the data dynamically as described above.

Oli
thumbnail
Ranga Rao Bobbili, geändert vor 11 Jahren.

RE: Problem in creating Custom Lucene Indexer for a new custom Entity

Regular Member Beiträge: 152 Beitrittsdatum: 20.07.07 Neueste Beiträge
Hi Oliver/Yogesh,
I am facing issue with retrieving search data from solr and tried following query.

Map<String, Serializable> attributes=new HashMap<String, Serializable>();
attributes.put("lpName", keywords); //Basically my entity object had 5 types of properties(id,lpName,type,createdDate,modifiedDate)
attributes.put("type", keywords);
SearchContext searchContext = new SearchContext();
searchContext.setAttributes(attributes);
searchContext.setCompanyId(10154);
Hits results = indexer.search(searchContext);

If i pass above query i am getting zero hits. But when i fire my query, solr console is showing below log message.

INFO: [] webapp=/solr path=/select params={hl.fragsize=80&fl=score&hl.snippets=3&start=0&q=%2B(%2B((%2B(entryClassName:com.xerox.ghs.he.portlet.searchentity.model.LibertyProgram))))
+%2BcompanyId:10154&facet.limit=-1&hl.fl=content&hl.fl=content_en_US&hl.fl=title&hl.fl=title_en_US&wt=javabin&hl=true&rows=5&version=1}
hits=3 status=0 QTime=2


Please find my original post and let me know, where i made mistake.
http://www.liferay.com/community/forums/-/message_boards/message/21180581

Thanks in advance..........

Best Regards,
Ranga Rao Bobbili
Adaequare INC