Autocomplete with couchdb and lucene

527 Views Asked by At

I'm using couchdb for storing the data of my app and couchdb-lucene (https://github.com/rnewson/couchdb-lucene) to implement search functionality for this data.

The search its ok, i can index couchdb documents into lucene a search for it. The problem its that now i want to implement autocomplete functionality for a better user experience, i look at the couchdb-lucene docs and i don't see nothing about how implement this.

my questions:

  • Its possible to implement autocomplete only with couchdb-lucene?
  • Its better to move to a most "complete" solution like solr or elasticsearch?
2

There are 2 best solutions below

0
On

For autocomplete you would need to implement prefix search with your data. For autocomplete the search has to be real fast. The problem grows with the volume of data. You can use in-memory solutions like redis to implement fast autocomplete. Autocomplete using Redis demo - http://autocomplete.redis.io/

If you dont want to implement autocomplete yourself you can also take any third party services/API.

0
On

Sounds like all you need is a prefix search with this and Lucene should provide that. But you can even do it with CouchDB Views.