可以为单个节点添加多个位置,并且solr可以显示搜索的所有位置? [英] Is it possible to add multiple location for a single node and solr can show all location for a search?

查看:293
本文介绍了可以为单个节点添加多个位置,并且solr可以显示搜索的所有位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况:假设您有多个位置的产品,当您搜索产品(而不是位置)时,您应该会看到所有位置。在Drupal中,您可以为位置使用多值字段(但在solr中我不知道)。当索引产品惠普solr时,您不应该发送它,假设3次(并持有它在DB中3次)只需一次。

The scenario: let's say you have a product in multiple location and when you search for the product (not for location) you should see all locations. In Drupal you can use multivalue fields for locations (but in solr I don't know). When index the product whit solr you should not send it, let's say, 3 time (and hold it in your DB 3 times) just once.

推荐答案

在sor中也可以有多值字段。

In sor also, you can have multivalued fields.

<field name="location" type="text" indexed="true" stored="true" multiValued="true"/>

因此,位置将是Solr中具有单个产品条目的多值条目。
这些位置将与产品文档一起返回,您可以根据需要对位置信息进行过滤。

So the location would be multivalued entries with a Single Product entry in Solr. The locations would be returned with the product document, and you can filter, facet on the location information as required.

这篇关于可以为单个节点添加多个位置,并且solr可以显示搜索的所有位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆