solr学习的一些小笔记

来源:互联网 发布:淘宝上哪家牛肉干好吃 编辑:程序博客网 时间:2024/05/12 14:45

solr的缓存热备


当重新打开一个SolrIndexSearcher的时候 ,可以设置是否触发缓存的热备处理


是否solr的缓存热备会将旧的缓存简单的拷贝到新的缓存空间里吗?


答案是否定的,因为这样的话,新的更新数据就看不到,所以它是将缓存的query再重新搜索一遍,再将结果缓存下来。这样就可以看到reader打开的数据



solr可以配置对于不同的字段使用不同的分析器Analyzer,因为底层lucene就可以为每个字段使用PerFieldAnalyzerWrapper代理处理Analyzer.


分布式同步配置

<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="master">
<str name="replicateAfter">startup</str>
<str name="replicateAfter">commit</str>
<str name="replicateAfter">optimize</str>
<str name="confFiles">elevate.xml,schema.xml,spellings.txt,stopwords.txt,stopwords_de.txt,stopwords_en.txt,synonyms_de.txt,synonyms.txt</str>
<str name="backupAfter">optimize</str>
<str name="numberToKeep">1</str>
</lst>
</requestHandler>




bq (Boost Query)

A raw query string (in the SolrQuerySyntax) that will be included with the user's query to influence the score. If this is a BooleanQuery with a default boost (1.0f) then the individual clauses will be added directly to the main query. Otherwise, the query will be included as is.

/!\ :TODO: /!\ That latter part is deprecated behavior but still works. It can be problematic so avoid it.

bf (Boost Function, additive)

Functions (with optional boosts) that will be included in the user's query to influence the score. Any function supported natively by Solr can be used, along with a boost value, e.g.: recip(rord(myfield),1,2,3)^1.5

Specifying functions with the "bf" param is just shorthand for using the _val_:"...function..." syntax in a "bq" param.

For example, if you want to show more recent documents first, use recip(ms(NOW,mydatefield),3.16e-11,1,1). SeeFunctionQuery for more functions.

The bf parameter may be specified multiple times.

boost (Boost Function, multiplicative)

As for 'bf' but multiplies the boost into the score.


 

原创粉丝点击