简体   繁体   English

使用Solrj对值进行构面

[英]Faceting on values using solrj

Can someone please tell how to do faceting on facet values. 有人可以告诉我们如何对方面值进行方面分析。 Lets say i have categories field which has facet values ["Clothing","FootWear","Accessories"] .Based on the Facet field "categories" im able to get the facetcount in the Queryresponse. 假设我有一个类别字段,该字段具有构面值[“服装”,“鞋类磨损”,“附件”]。基于“构面”字段中的“类别”,我无法在Queryresponse中获取构面计数。 my response looks like this: 我的回答如下:

Input request: http://127.0.0.1:8080/solr/selectfacet?q= : &facet.field=categories 输入请求: http : //127.0.0.1: 8080 /solr/selectfacet?q= &facet.field = categories

Response: 响应:

facet": [
    {
        "value": "Accessories",
        "count": ​2
    },
    {
        "value": "Clothing",
        "count": ​1
    },
    {
        "value": "Footwear",
        "count": ​1
    },
    {
        "value": "FootWear",
        "count": ​0
    }
]

What needs to be done if i need to choose only Footwear as facet field or Clothing as facet field. 如果我只需要选择“鞋类”作为“方面”字段或“服装”作为“方面”字段,该怎么办。 Also how to achieve multi select on 2 facet values and achieve the faceting using solrj api. 还有如何在2个构面值上实现多选并使用solrj api实现构面。 Some example codes will really help and may be proper links. 一些示例代码确实会有所帮助,并且可能是正确的链接。

You can specify parameter &fq=categories:Clothing,Accessories , so your query match only clothing field and facet would calculated base on matched result. 您可以指定参数&fq = categories:Clothing,Accessories,因此您的查询仅匹配服装字段,并且构面将根据匹配结果进行计算。

If your search query is different then require facet then using solr tag to exclude or include filter query condintion. 如果您的搜索查询不同,则要求方面,然后使用solr标记排除或包括过滤器查询条件。 see solr face wiki 请参阅solr face Wiki

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

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