简体   繁体   English

Solr中的facet是什么意思?

[英]what does facet in Solr means?

Can you please explain me , what is facet ? 你能解释一下,什么是方面? What did I understand is , suppose I have following documents. 我了解的是,假设我有以下文件。

State  Country
karntaka India
Bangalore India
Delhi     India
Noida     India

It collapse multiple same value of field to a single value and returns number of times that value occurred. 它将字段的多个相同值折叠为一个值,并返回该值出现的次数。 Now when i am search on field 'Country' then obviously I am getting 4 times India , So i keep facet=on and facet.field=Country, with a motive of getting only one time India , but when i fired query rather I am getting 现在,当我在“国家”字段中搜索时,很明显我得到的是印度的4倍,所以我保持facet = on和facet.field = Country的动机仅获得了一次印度,但是当我触发查询时,我是得到
some weird result 一些奇怪的结果

<lst name="responseHeader">
  <int name="status">0</int>
  <int name="QTime">6</int>
</lst>
<result name="response" numFound="4" start="0">
  <doc>
    <str name="country">India</str></doc>
  <doc>
    <str name="country">India</str></doc>
  <doc>
    <str name="country">India</str></doc>
  <doc>
    <str name="country">India</str></doc>
</result>
<lst name="facet_counts">
  <lst name="facet_queries"/>
  <lst name="facet_fields">
    <lst name="country">
      <int name="a">4</int>
      <int name="d">4</int>
      <int name="di">4</int>
      <int name="dia">4</int>
      <int name="i">4</int>
      <int name="ia">4</int>
      <int name="in">4</int>
      <int name="ind">4</int>
      <int name="indi">4</int>
      <int name="india">4</int>
    </lst>
  </lst>
  <lst name="facet_dates"/>
  <lst name="facet_ranges"/>
</lst>
</response>

Can any one help me to understand . 谁能帮我理解。 Thanks 谢谢

If you had a Washington, USA entry, the facet would report 4 results for India and 1 for USA . 如果您有美国Washington, USA录,该构面将报告India 4个结果和USA 1个结果。

Use a string field type. 使用string字段类型。 You seem to have used a (text) field with lowercasing and n-gramming, which may benefit people who spell India as Inde, for example. 您似乎在(text)字段中使用了小写和n-gramming,例如,这可能会使将印度拼写为Inde的人受益。 A string field is not processed like this and therefore its best suited for a field meant to be faceted. 字符串字段不会像这样处理,因此,它最适合要刻面的字段。

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

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