Elasticsearch Query

{

  "_source": [

    "_score",

    "name",

    "category_name",

    "brand"

  ],

  "from": 0,

  "size": 32,

  "sort": [

    {

      "is_in_stock": {

        "order": "desc"

      }

    },

    "_score"

  ],

  "query": {

    "filtered": {

      "filter": {

        "bool": {

          "must": [],

          "should": [

            {

              "missing": {

                "field": "child_discoverability"

              }

            },

            {

              "term": {

                "child_discoverability": "1"

              }

            }

          ]

        }

      },

      "query": {

        "function_score": {

          "query": {

            "filtered": {

              "filter": {

                "bool": {

                  "must": [

                    {

                      "exists": {

                        "field": "price"

                      }

                    },

                    {

                      "exists": {

                        "field": "brand_id"

                      }

                    },

                    {

                      "exists": {

                        "field": "search_weight"

                      }

                    },

                    {

                      "terms": {

                        "cats": [

                          "6224"

                        ]

                      }

                    },

                    {

                      "terms": {

                        "cats": [

                          "6224"

                        ]

                      }

                    }

                  ],

                  "must_not": []

                }

              },

              "query": {

                "bool": {

                  "should": [

                    {

                      "multi_match": {

                        "query": "iphone 32 gb black",

                        "analyzer": "word_delimiter_analyzer",

                        "fields": [

                          "category_name^6",

                          "brand^6",

                          "catagory_full_path^2",

                          "name^4",

                          "child_paytm_skus",

                          "description",

                          "attributes",

                          "attributes_list^4"

                        ],

                        "type": "cross_fields",

                        "tie_breaker": 0.3,

                        "boost": 5000

                      }

                    }

                  ]

                }

              }

            }

          },

          "functions": [

            {

              "script_score": {

                "lang": "expression",

                "script": "_score + log10((doc[\"pdp_view_count\"].value)+1)"

              }

            }

          ],

          "boost_mode": "replace"

        }

      }

    }

  },

  "post_filter": {

    "bool": {

      "must": [

        {

          "terms": {

            "cats": [

              "6224"

            ]

          }

        },

        {

          "terms": {

            "cats": [

              "66781"

            ]

          }

        }

      ]

    }

  }

}

Public Last updated: 2018-10-22 09:08:11 AM