Solr基础操作13

2022-06-29 22:39:45 浏览数 (2)

Pivot facets

其实也就是双重分组

facet.pivot=stream_size,title 先根据 stream_size 分组 ,再根据 title 分组

代码语言:javascript复制
[root@h102 solr-5.3.0]# curl "http://localhost:8983/solr/gettingstarted/select?q=*:*&rows=0&wt=json&indent=on&facet=on&facet.pivot=stream_size,title"
{
  "responseHeader":{
    "status":0,
    "QTime":5265,
    "params":{
      "facet":"on",
      "indent":"on",
      "q":"*:*",
      "wt":"json",
      "facet.pivot":"stream_size,title",
      "rows":"0"}},
  "response":{"numFound":3772,"start":0,"maxScore":1.0,"docs":[]
  },
  "facet_counts":{
    "facet_queries":{},
    "facet_fields":{},
    "facet_dates":{},
    "facet_ranges":{},
    "facet_intervals":{},
    "facet_heatmaps":{},
    "facet_pivot":{
      "stream_size,title":[{
          "field":"stream_size",
          "value":4812,
          "count":22,
          "pivot":[{
              "field":"title",
              "value":"Uses of Class org.apache.solr.cloud.OverseerSolrResponse (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.cloud.SocketProxy.Acceptor (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.core.CorePropertiesLocator (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.core.NIOFSDirectoryFactory (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.handler.DumpRequestHandler (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.handler.PingRequestHandler (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.handler.RealTimeGetHandler (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.response.CSVResponseWriter (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.response.PHPResponseWriter (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.response.RawResponseWriter (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.response.XMLResponseWriter (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.search.DisMaxQParserPlugin (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.search.ExportQParserPlugin (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.search.NestedQParserPlugin (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.search.PrefixQParserPlugin (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.search.ReRankQParserPlugin (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.search.SimpleQParserPlugin (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.search.SolrFieldCacheMBean (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.search.SwitchQParserPlugin (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.servlet.LoadAdminUiServlet (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.util.CryptoKeys.RSAKeyPair (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"Uses of Class org.apache.solr.util.PropertiesInputStream (Solr 5.3.0 API)",
              "count":1}]},
              ...
              ...
                 {
          "field":"stream_size",
          "value":1334,
          "count":2,
          "pivot":[{
              "field":"title",
              "value":"org.apache.solr.client.solrj.beans (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"org.apache.solr.search.join (Solr 5.3.0 API)",
              "count":1}]},
        {
          "field":"stream_size",
          "value":1377,
          "count":2,
          "pivot":[{
              "field":"title",
              "value":"org.apache.solr.handler.loader (Solr 5.3.0 API)",
              "count":1},
            {
              "field":"title",
              "value":"org.apache.solr.store.hdfs (Solr 5.3.0 API)",
              "count":1}]}]}}}
[root@h102 solr-5.3.0]# 

0 人点赞