Package lucandra

Examples of lucandra.IndexReader


            String indexName = (String) rb.req.getContext().get("solandra-index");

            if (indexName == null)
                throw new IOException("Missing core name");

            IndexReader reader = (IndexReader) ((SolrIndexReader) rb.req.getSearcher().getIndexReader()).getWrappedReader();

            reader.setIndexName(indexName);
           
            if(flushCache(indexName))
                reader.reopen();
           
            return false;
        }

        String indexName = (String) rb.req.getContext().get("solandra-index");

        if (indexName == null || indexName.equals(""))
        {
            return false; //
        }
        else
        {
            if(logger.isDebugEnabled())
                logger.debug("core: " + indexName);
        }

        if (rb.shards == null)
        {
            // find number of shards
            long docId = IndexManagerService.instance.getMaxId(indexName);

            int numShards = CassandraIndexManager.getShardFromDocId(docId);

            //run local
            if(numShards == 0) {
                IndexReader reader = (IndexReader) ((SolrIndexReader) rb.req.getSearcher().getIndexReader())
                .getWrappedReader();

                String subIndex = indexName+"~0";
                reader.setIndexName(subIndex);
               
                if(flushCache(subIndex))
                {
                    reader.reopen();               
                }
                return false;
            }
           
            // assign shards
View Full Code Here


            String indexName = (String) rb.req.getContext().get("solandra-index");

            if (indexName == null)
                throw new IOException("Missing core name");

            IndexReader reader = (IndexReader) ((SolrIndexReader) rb.req.getSearcher().getIndexReader()).getWrappedReader();

            reader.setIndexName(indexName);
           
            if(flushCache(indexName))
                reader.reopen();
           
            return false;
        }

        String indexName = (String) rb.req.getContext().get("solandra-index");

        if (indexName == null || indexName.equals(""))
        {
            return false; //
        }
        else
        {
            if(logger.isDebugEnabled())
                logger.debug("core: " + indexName);
        }

        if (rb.shards == null)
        {
            // find number of shards
            long docId = IndexManagerService.instance.getMaxId(indexName);

            int numShards = CassandraIndexManager.getShardFromDocId(docId);

            //run local
            if(numShards == 0) {
                IndexReader reader = (IndexReader) ((SolrIndexReader) rb.req.getSearcher().getIndexReader())
                .getWrappedReader();

                String subIndex = indexName+"~0";
                reader.setIndexName(subIndex);
               
                if(flushCache(subIndex))
                {
                    reader.reopen();               
                }
                return false;
            }
           
            // assign shards
View Full Code Here

TOP

Related Classes of lucandra.IndexReader

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.