# ElasticSearch no query hits on long field type

**URL:** <https://discuss.elastic.co/t/elasticsearch-no-query-hits-on-long-field-type/102222>\
**Category:** Elasticsearch\
**Created:** [September 29, 2017, 8:02am UTC](https://discuss.elastic.co/t/elasticsearch-no-query-hits-on-long-field-type/102222 "2017-09-29T08:02:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominik.safaric](https://avatars.discourse-cdn.com/v4/letter/d/b38774/32.png) [@dominik.safaric](https://discuss.elastic.co/u/dominik.safaric)\
**Post date:** [September 29, 2017, 8:02am UTC](https://discuss.elastic.co/t/elasticsearch-no-query-hits-on-long-field-type/102222/1 "2017-09-29T08:02:40Z")

</div>

I'm having a custom query plugin that aims at classifying documents as hit or not using a long field. The custom query has been implemented by extending the Lucene MultiTermQuery. Details may be found [here](https://discuss.elastic.co/t/querys-gettermsenum-not-executed/101501).

When I execute the query using the mapping below, no documents are returned in spite of having the long field indexed and stored. By debugging the query I found that the Lucene query does not load the field, hence the FilteredTermsEnum used for classifying document as hit or not is not execute.

What am I doing it wrong?

```
{
  "images" : {
    "mappings" : {
      "descriptors" : {
        "properties" : {
          "content_id_db" : {
            "type" : "integer"
          },
          "image_descriptor_long" : {
            "type" : "long"
          },
          "image_descriptor_short" : {
            "type" : "long"
          },
          "image_id_db" : {
            "type" : "integer"
          },
          "url" : {
            "type" : "keyword"
          }
        }
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 27, 2017, 8:02am UTC](https://discuss.elastic.co/t/elasticsearch-no-query-hits-on-long-field-type/102222/2 "2017-10-27T08:02:53Z")

</div>

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