简体   繁体   English

如何将标签与Solr中的文档相关联?

[英]How to Associate tags with documents in solr?

I have URLS with tags associated with them in my database, like below 我的数据库中有带有与之关联的标签的URL,如下所示

url : tag1(score) tag2(score)

eg: 例如:

www.w3schools.com: html(4.5) php(3.5) etc..
www.php.net: php(5) etc...

now, i'd like to store these links in solr with the weighted tags, and make them searchable, 现在,我想将这些链接与加权标签一起存储在solr中,并使其可搜索,

How can this be done in solr? 如何在Solr中完成? ` `

You could use index-time per-field boost, like so: 您可以使用索引时间每字段增强,如下所示:

<add>
  <doc>
    <field name="URL">stackoverflow.com</field>
    <field name="tag" boost="11.0">html</field>
    <field name="tag" boost="9.0">php</field>
  </doc>
</add>

The documentation is available here . 该文档可在此处获得

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM