【问题标题】:what's the difference of setting up a "field" and setting "facet=true" in search_indexes.py in haystack?在 haystack 中的 search_indexes.py 中设置“字段”和设置“facet=true”有什么区别?
【发布时间】:2012-04-17 00:54:54
【问题描述】:

我对 search_indexes.py 中的“field”和“facet=true”感到困惑

设置诸如 name=CharField(max_length=100) 之类的字段使我能够提供带有用户可以深入了解的名称的链接(窄搜索结果)?

并且 facet=true 给了我该字段的结果计数?

【问题讨论】:

    标签: django django-haystack faceted-search


    【解决方案1】:

    简短的回答是肯定的。然后你就可以在SearchQuerySet sqs 上操作了

    sqs = sqs.facet(field_to_facet).facet_count()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-02
      • 2021-04-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多