This reader does not support this method thrown by BoboIndexReader / Lucene 3.5.0

43 views
Skip to first unread message

mschipperheyn

unread,
Feb 1, 2012, 8:53:22 AM2/1/12
to bobo-browse
I just upgraded Bobo to 3.0.1 and Lucene 3.5.0.
When I call
public static BoboIndexReader getInstance(IndexReader reader,
Collection<FacetHandler<?
>> facetHandlers,

Collection<RuntimeFacetHandlerFactory<?,?>> facetHandlerFactories)
throws IOException

Lucene throws an Unsupported operation exception when Bobo tries to do
this

_dir = reader.directory(); (BoboIndexReader line 541)

Everything is maven retrieved, so I don't get this?

Kind regards,
Marc

mschipperheyn

unread,
Feb 1, 2012, 9:16:00 AM2/1/12
to bobo-browse
I also upgraded to Hibernate Search 4 as part of this upgrade cycle
and as it turns out the IndexReader supplied by defaults does not
support directory operations.

John Wang

unread,
Feb 1, 2012, 10:38:30 AM2/1/12
to bobo-...@googlegroups.com
Hi Marc:

    This bug is not yet fixed.

-John

--
You received this message because you are subscribed to the Google Groups "bobo-browse" group.
To post to this group, send email to bobo-...@googlegroups.com.
To unsubscribe from this group, send email to bobo-browse...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bobo-browse?hl=en.


mschipperheyn

unread,
Feb 2, 2012, 6:25:15 AM2/2/12
to bobo-browse
Ok, well, Hibernate does allow a backdoor to directly access the
Directory in order to give Bobo something to work with.

protected BoboIndexReader getBoboReader(final Class<?> clazz)
throws IOException {

TransactionTemplate transTemplate = new TransactionTemplate(
transactionManager);

IndexReader i = transTemplate
.execute(new TransactionCallback<IndexReader>() {

@Override
public IndexReader doInTransaction(
TransactionStatus status) {
FullTextSession fts = Search
.getFullTextSession(getSessionFactory()
.getCurrentSession());

MutableSearchFactory factory = (MutableSearchFactory)
fts.getSearchFactory();
DirectoryBasedIndexManager mgr = (DirectoryBasedIndexManager)
factory.getAllIndexesManager().getIndexManager(clazz.getCanonicalName());

try{

return
IndexReader.open(mgr.getDirectoryProvider().getDirectory(), true);

}catch(IOException io){

log.error("Error opening indexreader for Bobo", io);

}
return null;
}
});
return BoboIndexReader.getInstance(
i,
sfFactory.getUnfilteredList(), null);

}
}

Of course, what would be really cool is a BoboImplementation of the
Hibernate IndexManager. That could operate akin to Zoie.

Cheers,
Marc

On Feb 1, 1:38 pm, John Wang <john.w...@gmail.com> wrote:
> Hi Marc:
>
>     This bug is not yet fixed.
>
> -John
>
Reply all
Reply to author
Forward
0 new messages