Faceted search without Elasticsearch?

I am developing an offline-first iOS app that will leverage couchbase-lite but also has an HTML web interface.

The dataset is a product catalog that needs an Amazon.com style faceted search across an arbitrary set of product attributes with full-text query capabilities available offline for iOS.
Offline support for iOS is critical, as it will be used by agents in the field with llittle-to-no Internet connection.

Elasticsearch could take care of my problems for the web interface where offline capabilities are not so much of an issue, but I’m lost as to how to handle it for iOS?

Ideally I’d like a solution that can share as much code as possible and would produce the same results on web or mobile.

Can anyone suggest something I should try? Has anyone successfully created something similar before that can offer guidance? Any help at all is great appreciated.

Hi @jry123,
Interesting challenge you have here. Would it be a viable path to try and use Lucene?
The top of my head idea is to use the Map function in CB Lite to output document values to the Lucene Engine and then implement the navigational search based on the Lucene Engine.
This will most surely not be the same experience as Elastic search, but perhaps a valid compromise.

Hi @martinesmann ! Thanks for the reply. I was considering using Apache Lucy, but hadn’t really investigated how to go about it implementing it – your suggestion makes a lot of sense, I’m going to see what I can come up with and if I am able to generate anything substantial I’ll open source it. Thank you!

@jry123 Looking very much forward to an OSS project with this focus!

Are you developing in Objective C or .NET? I have some sample code that could help you on the way for .NET.
Let me know if you are interested.

@martinesmann Thank you very much for the offer, but I’m developing in Swift. I will need to create a bridge to the Apache Lucy library (written in C).

@jry123 Well then my .NET code snippets will not be of much help to you, but good luck with the project and looking very much forward learn more if you get it to work.