tantivy icon indicating copy to clipboard operation
tantivy copied to clipboard

on android: OS error 38 - function not implemented

Open Sivan22 opened this issue 1 year ago • 2 comments

Describe the bug i am using the library in my flutter app, through flutter_rust_bridge. it compiles and runs, but when trying to search i get the following error: Error: PanicException(Failed to create index reader: LockFailure(loError(Os {code:38, kind:Unsupported,message:"Function not implemented"}),None))

Which version of tantivy are you using? 0.22.0

To Reproduce

  • clone https://github.com/Sivan22/otzaria and https://github.com/Sivan22/otzaria_search_engine to the same folder.
  • cd otzaria
  • flutter run android
  • in the app, try searching

Sivan22 avatar Aug 28 '24 04:08 Sivan22

This is probably related to directory locking. What Directory implementation do you use?

PSeitz avatar Aug 28 '24 06:08 PSeitz

use tantivy::directory::MmapDirectory

let mmap_directory = MmapDirectory::open(path).expect("unable to open mmap directory"); let index = Index::open_or_create(mmap_directory, schema.clone()); let index = index.expect("Failed to create index").clone(); let index_reader = index.reader().expect("Failed to create index reader");

Sivan22 avatar Aug 28 '24 07:08 Sivan22

So my question is: what is status of supporting Mmap Directory on android? (the RamDirectory works as expected)

Sivan22 avatar Sep 03 '24 20:09 Sivan22

It is not supported

fulmicoton avatar Sep 24 '24 08:09 fulmicoton