1

There is an existing ehcache and lucene comparison sometime back and the answer is they can't be compared directly. However in EhCache 2.4, it now has search feature. We are thinking to migrate our currently Lucene solution into EhCache Search. One of the benefit I see is when EhCache is integrated with Terracotta, it can be become distributed cache and index easily. Any other concerns I should take account before the migration? Could anyone share their experience about EhCache Search as cache and index solution?

Thanks.

Update: After a quick test, it seems like EhCache Search does not allow cache to be persisted into disk. I got the below error if I try to set diskPersistent="true" on my ehcache.xml. Which mean the indexed cache need to be rebuilt everytime. I see this is one of the disadvantage.

Search attributes not supported by this store type: net.sf.ehcache.store.compound.impl.DiskPersistentStore

Community
  • 1
  • 1
Lee Chee Kiam
  • 11,450
  • 10
  • 65
  • 87
  • What if you use ehcache **in front** of Lucene? Let lucene do the indexing, and you can cache and distribute the results with ehcache. – luis.espinal Apr 02 '11 at 12:10

1 Answers1

0

Here are list of limitation:

  1. Can't persist searchable cache into disk.
  2. Custom AttributeExtractor only support certain types, which means you can't use search attribute with parameterize T like net.sf.ehcache.search.Attribute.eq(T), net.sf.ehcache.search.Attribute.between(T, T) etc but only net.sf.ehcache.search.Attribute.ilike(String) which may cause slower performance and less search constraint. I have to edit the EhCache source to make it support my custom type as I wish to use Attribute.eq(T).

Thanks.

Lee Chee Kiam
  • 11,450
  • 10
  • 65
  • 87