Package com.impetus.kundera.index

Examples of com.impetus.kundera.index.Indexer


            try
            {
                Method method = Class.forName(IndexingConstants.LUCENE_INDEXER).getDeclaredMethod("getInstance",
                        String.class);

                Indexer indexer = (Indexer) method.invoke(null, luceneDirectoryPath);
                indexManager = new IndexManager(indexer, kunderaMetadata);
            }
            catch (Exception e)
            {
                logger.error(
                        "Missing lucene from classpath. Please make sure those are available to load lucene directory {}!",
                        luceneDirectoryPath);
                throw new InvalidConfigurationException(e);
            }

            // indexManager = new IndexManager(LuceneIndexer.getInstance(new
            // StandardAnalyzer(Version.LUCENE_CURRENT),
            // luceneDirectoryPath));
        }
        else if (indexerClass != null)
        {
            try
            {
                Class<?> indexerClazz = Class.forName(indexerClass);
                Indexer indexer = (Indexer) indexerClazz.newInstance();
                indexManager = new IndexManager(indexer, kunderaMetadata);
                clientMetadata.setIndexImplementor(indexerClass);
            }
            catch (Exception cnfex)
            {
View Full Code Here


     */
    private void addIndex(final Object connection, final AttributeWrapper wrapper, final String rowKey,
            final EntityMetadata metadata)
    {

        Indexer indexer = indexManager.getIndexer();

        if (indexer != null)
        {
            // Add row key to list(Required for wild search over table).
            wrapper.addIndex(
                    getHashKey(metadata.getTableName(),
                            ((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName()), getDouble(rowKey));

            // Add row-key as inverted index as well needed for multiple clause
            // search with key and non row key.
            wrapper.addIndex(
                    getHashKey(metadata.getTableName(),
                            getHashKey(((AbstractAttribute) metadata.getIdAttribute()).getJPAColumnName(), rowKey)),
                    getDouble(rowKey));

            indexer.index(metadata.getEntityClazz(), metadata, wrapper.getIndexes(), rowKey, null);
        }
    }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.index.Indexer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.