3

I have an application built with Spring+JPA+Hibernate running on Heorku, and I use Hibernate-Search for FullTextSearch. On my local machine i store my indexes on file system. My configuration in persistence.xml.

<property name="hibernate.search.default.directory_provider" 
    value="filesystem"/> 
<property name="hibernate.search.default.indexBase" 
    value="/opt/lucene/indexes"/> 

Heroku has only-read access to the file system, then i store the indexes in memory, but it is no the best approach, because the indexes are lost when the server instance restart. How would best way to do this? there's a way to integrate hibernate search with WebSolr or something else?

VirtualTroll
  • 3,077
  • 1
  • 30
  • 47
maykoone
  • 31
  • 2
  • Heroku does not have a read-only filesystem (on Cedar); you are only discouraged from writing to the filesystem because your multiple nodes may get out of sync. If you are certain that the indexes will be generated identically on each node or that having different indexes on each node is not a problem, then you can write to the filesystem. I would still favor an approach wiring your app up to one of Heroku's many excellent search add-ons, though. – Andrew Gorcester Dec 14 '12 at 17:40
  • Heroku has a ephemeral file system," which means you cannot dynamically write to the filesystem for semi-permanent storage". Which add-on for search i could integrate with hibernate search? – maykoone Dec 14 '12 at 19:49
  • Yes, also forgot to mention that ti's ephemeral so you would have to regenerate indexes every boot. Unfortunately I'm not sure how to wire Hibernate up to one of their add-ons as opposed to wiring some other system up, so hopefully someone will leave a proper answer with that info. – Andrew Gorcester Dec 14 '12 at 19:58
  • I found a solution. I'll use mongodb add-on on heroku to store my indexes, i have implemented a directory provider for hibernate search based on mongodb directory for lucene and works fine on my local machine. – maykoone Dec 15 '12 at 15:30
  • Great! I suggest you add that as an "answer" and accept it yourself so it will be useful to other people who stumble upon this page. – Andrew Gorcester Dec 15 '12 at 18:56

1 Answers1

0

I found a solution. I'll use mongodb add-on on heroku to store my indexes, i have implemented a directory provider for hibernate search based on mongodb directory for lucene and works fine on my local machine.

maykoone
  • 31
  • 2