Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android app + SOLR

Tags:

android

solr

I would like to use SOLR to do search on my android app. Is this something that I can do? If so could you please point me to some code samples out there? Thanks

like image 401
Buju Avatar asked Oct 14 '25 07:10

Buju


2 Answers

Depends. Solr is a quite heavy server application, it's not really suited to run on an Android device.

You'll want to run Solr on a server somewhere and have your Android app connect to Solr via HTTP.

However, Solr is not designed to be used as a public HTTP application (see the Solr security wiki page), so it's generally best to write a small web service that acts as a proxy and at the same time offers a simplified, tailored API for your Android app.

like image 50
Mauricio Scheffer Avatar answered Oct 17 '25 00:10

Mauricio Scheffer


In a particular Android application I know, they use an API endpoint written in a Python framework which talks JSON. They use both MySQL and Solr for persistence and some kinds of data is stored exclusively in Solr. And yes, they are using Solr for it's query capabilities.

Do follow a "Android client <-> API <-> persistence layer" design; dont expose any databases directly to the android client. As Mauricio Scheffer pointed out, Solr is not smart enough to secure itself from a delete * from someone who reverse-engineered your app; a properly designed API can handle illegal requests.

like image 22
Jesvin Jose Avatar answered Oct 16 '25 22:10

Jesvin Jose