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>
参数不解释。

相关文章:

  • 2022-12-23
  • 2021-06-13
  • 2021-11-30
  • 2021-09-24
  • 2021-12-22
  • 2021-09-28
  • 2021-11-08
  • 2021-11-15
猜你喜欢
  • 2021-06-08
  • 2021-11-25
  • 2022-03-07
  • 2021-08-27
  • 2021-12-05
  • 2021-09-16
  • 2021-07-27
相关资源
相似解决方案