摘要: boolean org.apache.solr.update.processor.DistributedUpdateProcessor.getUpdatedDocument(AddUpdateCommand cmd, long versionOnUpdate) throws IOExceptionsolr的更新的方法 原来是先查一遍再更新 阅读全文
posted @ 2013-02-17 23:40 镆涵 阅读(141) 评论(0) 推荐(0)
摘要: solr的分组和统计功能http://localhost:8983/solr/select?q=*:*&stats=true&stats.field=price&stats.field=popularity&rows=0&indent=truehttp://localhost:8983/solr/collection1/select?q=*%3A*&wt=xml&indent=true&group=true&group.field=popularity&group.ngroups=true可以实现 sum min等 阅读全文
posted @ 2013-02-17 23:37 镆涵 阅读(854) 评论(0) 推荐(0)
摘要: SolrIndexSearcher.getDocListC(SolrIndexSearcher$QueryResult, SolrIndexSearcher$QueryCommand) line: 1142 SolrIndexSearcher.search(SolrIndexSearcher$QueryResult, SolrIndexSearcher$QueryCommand) line: 390 QueryComponent.process(ResponseBuilder) line: 411 SearchHandler.handleRequestBody(SolrQueryRequest 阅读全文
posted @ 2013-01-24 16:07 镆涵 阅读(122) 评论(0) 推荐(0)
摘要: 接着写solr的预热过程void org.apache.solr.search.SolrIndexSearcher.warm(SolrIndexSearcher old) throws IOException会预热所有缓存try { this.cacheList[i].warm(this, old.cacheList[i]); } finally { try { req.close(); } finally { SolrRequestInfo.clearRequestInfo(); } }LRUCache的预热方法:void org.apache.solr.search.LRUCache.wa 阅读全文
posted @ 2013-01-24 16:05 镆涵 阅读(207) 评论(0) 推荐(0)
摘要: solr的缓存策略分3种LRUCache:使用LinkedHashMap来保存缓存,覆盖了removeEldestEntry方法,并提供了预热方法: public void warm(SolrIndexSearcher searcher, SolrCache<K,V> old) { if (regenerator==null) return; long warmingStartTime = System.currentTimeMillis(); LRUCache<K,V> other = (LRUCache<K,V>)old; // warm entries 阅读全文
posted @ 2013-01-21 13:34 镆涵 阅读(361) 评论(0) 推荐(0)
摘要: 这是我的另外一篇博客 和http://blog.csdn.net/zhang_mohan 比较看哪个好使 就最终选哪个试试代码效果 1 synchronized (getUpdateLock()) { 2 cmdExecutor.ensureExists(CLUSTER_STATE, zkClient); 3 4 log.info("Updating cluster state from ZooKeeper... "); 5 6 zkClient.exists(CLUSTER_STATE, new Watcher()... 阅读全文
posted @ 2013-01-21 13:11 镆涵 阅读(379) 评论(0) 推荐(0)