Zero result?

Hi ,

This is my mapping:

    {
      "lodgings_development_20180523154411698": {
        "mappings": {
          "lodging": {
            "_all": {
              "enabled": false
            },
            "dynamic_templates": [
              {
                "string_template": {
                  "match": "*",
                  "match_mapping_type": "string",
                  "mapping": {
                    "fields": {
                      "analyzed": {
                        "analyzer": "searchkick_index",
                        "index": true,
                        "type": "text"
                      }
                    },
                    "ignore_above": 30000,
                    "type": "keyword"
                  }
                }
              }
            ],
            "properties": {
              "adults": {
                "type": "long"
              },
              "availability_adults": {
                "type": "long"
              },
              "availability_children": {
                "type": "long"
              },
              "availability_infants": {
                "type": "long"
              },
              "availability_price": {
                "type": "float"
              },
              "available_on": {
                "type": "date"
              },
              "baths": {
                "type": "long"
              },
              "beds": {
                "type": "long"
              },
              "children": {
                "type": "long"
              },
              "city": {
                "type": "keyword",
                "fields": {
                  "analyzed": {
                    "type": "text",
                    "analyzer": "searchkick_index"
                  },
                  "text_start": {
                    "type": "text",
                    "analyzer": "searchkick_text_start_index"
                  }
                },
                "ignore_above": 30000
              },
              "created_at": {
                "type": "date"
              },
              "id": {
                "type": "long"
              },
              "infants": {
                "type": "long"
              },
              "latitude": {
                "type": "float"
              },
              "location": {
                "type": "geo_point"
              },
              "lodging_type": {
                "type": "keyword",
                "fields": {
                  "analyzed": {
                    "type": "text",
                    "analyzer": "searchkick_index"
                  }
                },
                "ignore_above": 30000
              },
              "longitude": {
                "type": "float"
              },
              "price": {
                "type": "long"
              },
              "sale_date": {
                "type": "date"
              },
              "sq__ft": {
                "type": "float"
              },
              "state": {
                "type": "keyword",
                "fields": {
                  "analyzed": {
                    "type": "text",
                    "analyzer": "searchkick_index"
                  }
                },
                "ignore_above": 30000
              },
              "street": {
                "type": "keyword",
                "fields": {
                  "analyzed": {
                    "type": "text",
                    "analyzer": "searchkick_index"
                  }
                },
                "ignore_above": 30000
              },
              "updated_at": {
                "type": "date"
              },
              "zip": {
                "type": "keyword",
                "fields": {
                  "analyzed": {
                    "type": "text",
                    "analyzer": "searchkick_index"
                  }
                },
                "ignore_above": 30000
              }
            }
          }
        }
      }
    }

**Then this is my query** 
    GET /lodgings_development/_search
            {
              "query": {
                "bool": {
                  "must": {
                    "match_all": {}
                  },
                  "filter": [
                    {
                      "terms": {
                        "available_on": [
                          "2018-06-06",
                          "2018-06-07",
                          "2018-06-08"
                        ]
                      }
                    },
                    {
                      "term": {
                        "adults": "1"
                      }
                    },
                    {
                      "term": {
                        "children": "0"
                      }
                    },
                    {
                      "term": {
                        "infants": "0"
                      }
                    },
                    {
                      "term": {
                        "lodging_id": 14
                      }
                    }
                  ]
                }
              },
              "timeout": "11s",
              "_source": false,
              "size": 10000,
              "from": 0
            }

GET zero results! Is my query not ok??

There is no lodging_id defined in the mappings and you are filtering on it...

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.