BeanIndex



Installation :

1. Download BeanIndex binary with source in zip format from here .
2. Unzip the file into your-unzip-directory. Example /tmp
3. Copy beanindex.jar file to your application class path.

Developing applications using BeanIndex :

Browse BuildExample.java.

Browse SearchExample.java.

Download example zip file available here which includes example code for build, hotdeploy, selfdeploy, dataprovider initiated deploy and search.
This zip file includes the above mentioned examples, Eclipse project setup files and Ant build.xml file for convenience.

Runtime settings for optimal memory utilization and search performance

BeanIndexBuilder can use disk space for intermediate datasets during the index building process.
Build process would run longer conserving RAM. Example code.
   String beanIndexDirectory = null; // defaults to the working directory
   BeanIndex beanIndex = new BeanIndex(beanIndexDirectory);
   BeanIndexMetaInfo metaInfo = new BeanIndexMetaInfo(params...);
   boolean useDisk = true;
   BeanIndexBuilder indexBuilder = beanIndex.getBeanIndexBuilder(metaInfo,useDisk);

BeanIndexSearcher can use cache to speed up response time. BeanIndex running on a SMP hardware could benefit from multi threaded search capabilities.
Example code.
    SearcherConfigInfo configInfo = new SearcherConfigInfo();
   configInfo.setDataCacheEnabled(true); // enables Bean Cache
   configInfo.setDataCacheMaxSize(5000); // Bean Cache size
   configInfo.setIndexCacheEnabled(true); // enables Index node cache
   configInfo.setIndexCacheMaxSize(2000); // Index node cache size
   configInfo.setThreadPoolEnabled(true); // for multithreaded searching
   configInfo.setThreadPoolMaxSize(20); // max thread pool size
   beanIndexSearcher = beanIndex.getBeanIndexSearcher(configInfo);

Limitations

   BeanIndex requires the Bean being indexed to implement java.io.Serializable interface if the bean has any one of it's field type as Java Collection Framework container, example Collection,List,Map,Set and their derivatives.
   BeanIndex search result does not include Relevancy ranking as it happens in Full-Text search tools.
   BeanIndex requires JDK 1.4_X .
   Dictionary file size cannot exceed 2GB.

Logical Expression

BeanIndex supports logical expressions AND, OR and NOT as part of a searchterm. Use ( and ) for precedence.

   Examples :    river and sky ,boat or water , man or boat not river, (pet and ( cat or dog) ) not snake

WildCard

BeanIndex supports including wildcards ? and * as part of a searchterm.

   1. Searching business* would include businessman,businesswoman and etc. in the result
   2. Searching ca? would include car, can and etc. in the result
   3, Searching m? n would include man , men and etc. in the result
   4. Searching m* n would include man, men, moon and etc. in the result

Runtime directory structure

   1. beanindex -- The root data directory
   2. beanindex/deploy -- Place new index dataset here for deployment
   3, beanindex/rtworkspace -- The Runtime Workspace, the deployed index dataset lives here.
   4. beanindex/rtworkspace_bkp -- Previous rtworkspace content after a succesful deployment.