Solr的相关推荐其实用了Lucene的MoreLikeThis,在Solr使用很简单,只需简单配置即可。
//配置如下:
<!-- request handler likehua -->
<requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
</requestHandler>
请求:http://localhost:1985/solr/mlt?q=geo_name:HJ&mlt.true&mlt.fl=name&mlt.mintf=1&mlt.mindf=1
请求结果:
<?
xml version="1.0" encoding="UTF-8"
?>
<
int
name
="
status
"
>
0
</
int
>
<
int
name
="
QTime
"
>
656
</
int
>
</
lst
>
<
str
name
="
geo_name
"
>
HJ1B-CCD1-26-74-L20000034219
</
str
>
<
str
name
="
geo_summary
"
>
GEOTIFF
</
str
>
<
str
name
="
id
"
>
5662528
</
str
>
</
doc
>
</
result
>
<
result
name
="
response
"
numFound
="
0
"
start
="
0
"
/>
</
response
>
参数不解释。