Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 6.14 KB | None | 0 0
  1. {  
  2.    "query":{  
  3.       "filtered":{  
  4.          "filter":{  
  5.             "bool":{  
  6.                "must":[  
  7.                   {  
  8.                      "nested":{  
  9.                         "path":"work.publication",
  10.                         "query":{  
  11.                            "bool":{  
  12.                               "must":[  
  13.                                  {  
  14.                                     "terms":{  
  15.                                        "work.publication.format":[  
  16.                                           "Book"
  17.                                        ]
  18.                                     }
  19.                                  },
  20.                                  {  
  21.                                     "terms":{  
  22.                                        "work.publication.language":[  
  23.                                           "Norwegian"
  24.                                        ]
  25.                                     }
  26.                                  }
  27.                               ]
  28.                            }
  29.                         }
  30.                      }
  31.                   }
  32.                ]
  33.             }
  34.          },
  35.          "query":{  
  36.             "bool":{  
  37.                "should":[  
  38.                   {  
  39.                      "multi_match":{  
  40.                         "query":"USER_INPUT",
  41.                         "fields":[  
  42.                            "work.mainTitle^2",
  43.                            "work.partTitle"
  44.                         ]
  45.                      }
  46.                   }
  47.                ]
  48.             }
  49.          }
  50.       }
  51.    },
  52.    "size":10,
  53.    "aggregations":{  
  54.       "all":{  
  55.          "global":{  
  56.  
  57.          },
  58.          "aggregations":{  
  59.             "work.publication.format":{  
  60.                "filter":{  
  61.                   "and":[  
  62.                      {  
  63.                         "bool":{  
  64.                            "should":[  
  65.                               {  
  66.                                  "multi_match":{  
  67.                                     "query":"USER_INPUT",
  68.                                     "fields":[  
  69.                                        "work.mainTitle^2",
  70.                                        "work.partTitle"
  71.                                     ]
  72.                                  }
  73.                               }
  74.                            ]
  75.                         }
  76.                      },
  77.                      {  
  78.                         "bool":{  
  79.                            "must":{  
  80.                               "nested":{  
  81.                                  "path":"work.publication",
  82.                                  "query":{  
  83.                                     "bool":{  
  84.                                        "must":[  
  85.                                           {  
  86.                                              "terms":{  
  87.                                                 "work.publication.language":[  
  88.                                                    "Norwegian"
  89.                                                 ]
  90.                                              }
  91.                                           }
  92.                                        ]
  93.                                     }
  94.                                  }
  95.                               }
  96.                            }
  97.                         }
  98.                      }
  99.                   ]
  100.                },
  101.                "aggregations":{  
  102.                   "work.publication.format":{  
  103.                      "nested":{  
  104.                         "path":"work.publication"
  105.                      },
  106.                      "aggregations":{  
  107.                         "work.publication.format":{  
  108.                            "terms":{  
  109.                               "field":"work.publication.format"
  110.                            }
  111.                         }
  112.                      }
  113.                   }
  114.                }
  115.             },
  116.             "work.publication.language":{  
  117.                "filter":{  
  118.                   "and":[  
  119.                      {  
  120.                         "bool":{  
  121.                            "should":[  
  122.                               {  
  123.                                  "multi_match":{  
  124.                                     "query":"USER_INPUT",
  125.                                     "fields":[  
  126.                                        "work.mainTitle^2",
  127.                                        "work.partTitle"
  128.                                     ]
  129.                                  }
  130.                               }
  131.                            ]
  132.                         }
  133.                      },
  134.                      {  
  135.                         "bool":{  
  136.                            "must":{  
  137.                               "nested":{  
  138.                                  "path":"work.publication",
  139.                                  "query":{  
  140.                                     "bool":{  
  141.                                        "must":[  
  142.                                           {  
  143.                                              "terms":{  
  144.                                                 "work.publication.format":[  
  145.                                                    "Book"
  146.                                                 ]
  147.                                              }
  148.                                           }
  149.                                        ]
  150.                                     }
  151.                                  }
  152.                               }
  153.                            }
  154.                         }
  155.                      }
  156.                   ]
  157.                },
  158.                "aggregations":{  
  159.                   "work.publication.language":{  
  160.                      "nested":{  
  161.                         "path":"work.publication"
  162.                      },
  163.                      "aggregations":{  
  164.                         "work.publication.language":{  
  165.                            "terms":{  
  166.                               "field":"work.publication.language"
  167.                            }
  168.                         }
  169.                      }
  170.                   }
  171.                }
  172.             }
  173.          }
  174.       }
  175.    }
  176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement