tantivy icon indicating copy to clipboard operation
tantivy copied to clipboard

Can it be reliably used for mobile in a production environment

Open BingCoke opened this issue 6 months ago • 7 comments
trafficstars

Hello! This project is truly amazing! Thank you for all the effort you've put into it. Currently, I have a small question regarding its compatibility with mobile devices. The official README documentation states that it runs stably on desktop platforms (Linux, Mac, Windows), so I’d like to ask about its stability on mobile. Can it be reliably used for mobile in a production environment?

I’ve already built a simple search app using iOS and Android virtual machines based on Tantivy, and I’ve tested basic search functionality without any issues (though I haven’t delved deeply into it yet). I’d like to use it as a search engine for mobile, but I’m concerned that official support for mobile might be insufficient. If problems arise, I might have to switch to another search engine, which would be troublesome.

BingCoke avatar May 07 '25 04:05 BingCoke

Creating indices may cause problems, due to missing locking functionality on the file system. Otherwise it should be fine.

PSeitz avatar May 07 '25 05:05 PSeitz

due to missing locking functionality on the file system

Thank you for your prompt reply! So how should I avoid this issue? Should I create only one corresponding index globally in the app to prevent locking? We probably won't create multiple indexes in a single directory to improve performance.

BingCoke avatar May 07 '25 06:05 BingCoke

I think you would need to implement your own Directory without the locking calls

PSeitz avatar May 07 '25 06:05 PSeitz

I think you would need to implement your own Directory without the locking calls

Okay, I understand. Thank you for your reply—it means a lot to me!

BingCoke avatar May 07 '25 07:05 BingCoke

Hello @PSeitz ! I reopened the issue and hope I'm not disturbing you. I took a look at the implementation of acquire_lock, which is based on the fs4::fs_std::FileExt library, and this library depends on rustix. I checked this library and found that it already supports Android and iOS, with CI/CD builds for these platforms. So I think this issue might not actually exist?

Alternatively, it could be that we're using an outdated version of fs4—currently version 0.8.0, which was released over a year ago. Maybe mobile platform support wasn't as robust back then (the ecosystem has improved over the past year, enhancing cross-platform compatibility).

Is there a specific reason for not using the latest version? If there are no particular concerns, I’d be happy to take on the task of updating it

BingCoke avatar May 07 '25 11:05 BingCoke

Closely watching this issue as raised by @BingCoke. We are keen on finding a robust search engine to embed in our mobile app. Is his assumption correct that we might be there already, just by bumping the FileExt lib?

1Cor125 avatar Jun 09 '25 20:06 1Cor125

I’m also interested in this similiar to @1Cor125.

velocitysystems avatar Jun 09 '25 20:06 velocitysystems

@PSeitz, @BingCoke, @velocitysystems, et al.: FWIW, I created a pull request to update fs4 to 0.13.1. A minor, one-line code change was needed. The existing tests pass.

I'm going to try and find time to do integration testing on Android and iOS devices to see if this is a reliable option for mobile or what it would take to make it so.

1Cor125 avatar Jun 21 '25 21:06 1Cor125

I'm in a similar situation. This sounds very promising, any progress?

Lastofthefirst avatar Jul 06 '25 13:07 Lastofthefirst