Solr Cookbook学习记录 - 第6,8,9章
来源:互联网 发布:cf网络异常的解决办法 编辑:程序博客网 时间:2024/06/06 12:44
第6章 改进solr的性能
1. Paging your results quickly,编辑solrconfig.xml:<queryResultWindowSize>160</queryResultWindowSize><queryResultMaxDocsCached>160</queryResultMaxDocsCached>2. 配置document缓存,编辑solrconfig.xml:<documentCache class="solr.LRUCache" size="2560" initialSize="2560"/>3. 配置query result缓存,编辑solrconfig.xml:<queryResultCache class="solr.LRUCache" size="16000" initialSize="16000" autowarmCount="4000"/>4. 配置filter缓存,编辑solrconfig.xml:<filterCache class="solr.FastLRUCache" size="2000" initialSize="2000" autowarmCount="1000"/>5. 。。。
第8章
1. 相似度查询/select?q=cookbook second&mm=2&qf=name&defType=edismax&mlt=true&mlt.fl=name&&mlt.mintf=1&mlt.mindf=12. 高亮显示/select?q=name:book&hl=true3. 高亮显示指定的字段/select?q=name:book&hl=true&hl.fl=name,description4. 改变高亮显示词两边的html标签/select?q=name:book&hl=true&hl.simple.pre=<b>&hl.simple.post=</b>5. 如何高亮显示长文本中的词<field name="name" type="text" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" />/select?q=name:book&hl=true&hl.useFastVectorHighlighter=true6. 计算统计搜索结果/select?q=name:book&stats=true&stats.field=price7. 检查用户的拼写错误/spell?q=name:(othar boak)配置solrconfig.xml:<searchComponent name="spellcheck" class="solr.SpellCheckComponent"><str name="queryAnalyzerFieldType">name</str><lst name="spellchecker"><str name="name">direct</str><str name="field">name</str><str name="classname">solr.DirectSolrSpellChecker</str><str name="buildOnCommit">true</str></lst></searchComponent><requestHandler name="/spell" class="solr.SearchHandler" startup="lazy"> <lst name="defaults"> <str name="df">name</str> <str name="spellcheck.dictionary">direct</str> <str name="spellcheck">on</str> <str name="spellcheck.collate">true</str> </lst> <arr name="last-components"> <str>spellcheck</str> </arr></requestHandler>8. Using field value to group results/select?q=*:*&group=true&group.field=category9. More than a single document in a group/select?q=*:*&group=true&group.field=category&group.limit=1010. Using queries to group results/select?q=*:*&group=true&group.query=price: [20.0 TO 50.0]&group.query=price:[1.0 TO 19.99]11. Using function queries to group results/select?q=*:*&group=true&group.func=geodist(geo,0.0,0.0)
第9章
1. How to deal with too many opened files异常:java.io.FileNotFoundException: /use/share/solr/data/index/_1.fdx (Too many open files)编辑/etc/security/limits.confsolr soft nofile 32000solr hard nofile 32000Now let's add the following line to the .bash_profile file in the solr user home directory: ulimit -n 32000编辑solrconfig.xml<mergeFactor>2</mergeFactor>2. How to deal with out-of-memory problems异常:SEVERE: java.lang.OutOfMemoryError: Java heap spacejava –Xmx1024M –Xms512m –jar start.jarMonitoring heap when an out-of-memory error occursjava –jar –XX:+HeapDumpOnOutOfMemoryError –XX:HeapDumpPath=/var/log/dump/ start.jar3. 诊断solr的问题vmstat, dstat, and iostatjconsole and jvisualvm使用http://sematext.com/spm/index.html监测solr还可以使用:http://ganglia.sourceforge.net/http://munin-monitoring.org/http://www.zabbix.com/http://www.cacti.nethttp://newrelic.com/4. 查询某分类下的产品数量(以牛奶开头的产品)/select?q=*:*&rows=0&facet=true&facet.field=category&facet.mincount=1&facet.limit=5&facet.prefix=牛奶5. ???/select?q=*:*&defType=edismax&fq={!term f=category}Books And Tutorials6. 提交xml文档curl 'http://localhost:8983/solr/update' --data-binary @data.xml -H 'Content-type:application/xml'curl 'http://localhost:8983/solr/update?softCommit=true'7. solrconfig.xml中配置autoCommit<autoCommit> <maxTime>60000</maxTime> <openSearcher>false</openSearcher></autoCommit><autoSoftCommit> <maxTime>1000</maxTime></autoSoftCommit>8. ???/select?q=solr book&defType=edismax&mm=1&qf=name^10000 description
0 0
- Solr Cookbook学习记录 - 第6,8,9章
- Solr Cookbook学习记录 - 第五章 Faceting
- Solr Cookbook学习记录 - 第一章Solr配置
- Solr Cookbook学习记录 - 第二章indexing your data
- Solr Cookbook学习记录 - Facet学习
- Solr Cookbook学习记录 - Highlighting学习
- Solr Cookbook学习记录 - MoreLikeThis学习
- solr学习记录
- solr学习记录
- solr学习记录1
- solr学习记录
- Linux Shell Scripting Cookbook 学习记录1
- solr 安装配置学习记录
- NHibernate Cookbook 学习笔记 6
- cookbook第4章 收藏功能实现
- cookbook第5章 tabtable界面
- 第四周:Hadoop学习 志COOKBOOK图书介绍
- SQL Cookbook阅读记录
- 用最小代价实现双电源供电自动切换
- centos 6.2 安装mysql-5.5.17
- STM32通用定时器---基本定时学习
- [Leetcode] Integer to Roman (Java)
- 递归折半查找多个相同元素中的第一个或者最后一个
- Solr Cookbook学习记录 - 第6,8,9章
- [学习笔记] C++ 初体验
- node 调试脚本
- 一个基于RSA算法的Java数字签名例子
- RHEL 5基础篇—Linux常用命令参考手册
- KVC (Key-Value Coding)
- STM32单片机学习---PWM输出
- 欢迎大家关注我的微信帐号!
- 遍历数组—三种内置的方法