Solr配置相关推荐

     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" ?>
- < response >
- < lst name =" responseHeader " >
  < int name =" status " > 0 </ int >
  < int name =" QTime " > 656 </ int >
  </ lst >
- < result name =" match " numFound =" 8819289 " start =" 0 " >
- < doc >
  < 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 >
参数不解释。

你可能感兴趣的:(Solr)