I am developing an application which makes use of JCS. i do know how to retrive the data from the catch when searchkey is a complete string. I need to implement max-match search in JCS.
For example : cache contains following data.
when user inputs just 1 for book number it should fetch all the book title with book number starting with 1. i.e it should list
It is the kind of search we do in sql using 'like and %' .
Kindly help me.
Thanks in advance!!!
You should be able to to do something like this:
JCSAdminBean admin = new JCSAdminBean();
LinkedList<CacheElementInfo> cacheElements = admin.buildElementInfo("myCache");
for (CacheElementInfo e : cacheElements) {
if (e.getKey().startsWith("1")) {
//do something.. store it in a list?
}
}
Try it out and let me know if that works for you.