0

Following the example on the ScalaARM homepage I wrote this:

for ( ir: IndexReader <- managed(DirectoryReader.open(FSDirectory.open(file)))) { ... }

(Open a lucene IndexReader)

however I get this compilation error:

Error:(34, 45) Play 2 Compiler: Indexer.scala:34: value filter is not a member of resource.ManagedResource[org.apache.lucene.index.DirectoryReader] for ( ir: IndexReader <- managed(DirectoryReader.open(FSDirectory.open(file)))) {

Can someone explain what is happening here? ^

1 Answers1

1

So it seems the problem was the return type of the call to managed. I dropped the IndexReader type and it's fine now:

for ( ir <- managed(DirectoryReader.open(FSDirectory.open(file)))) { ... }