# Making a simple query

**URL:** <https://discuss.elastic.co/t/making-a-simple-query/105471>\
**Category:** Elasticsearch\
**Created:** [October 26, 2017, 7:21pm UTC](https://discuss.elastic.co/t/making-a-simple-query/105471 "2017-10-26T19:21:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakobdo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakobdo/32/23475_2.png) [@jakobdo](https://discuss.elastic.co/u/jakobdo)\
**Post date:** [October 26, 2017, 7:21pm UTC](https://discuss.elastic.co/t/making-a-simple-query/105471/1 "2017-10-26T19:21:48Z")

</div>

Hello,  
i am new into this Elasticsearch, but i try to learn how to extract data from the danish [virk.dk](http://virk.dk).  
They have this mapping: [http://distribution.virk.dk/cvr-permanent/\_mapping](http://distribution.virk.dk/cvr-permanent/_mapping)  
I have a login, which works just fine, i can do some queries.  
This works:

```
{
"_source": "Vrvirksomhed.virksomhedMetadata.nyesteNavn.navn",
  "query": {
    "term": {
      "cvrNummer": 13612870
    }
  }
}

```

It returns data like:

```
"_source": {
  "Vrvirksomhed": {
    "virksomhedMetadata": {
      "nyesteNavn": {
        "navn": "MICROSOFT DANMARK ApS"
      }
    }
  }
}

```

Then i would expect that i could do a _reversed_ query like this:

```
{
"_source": "Vrvirksomhed.cvrNummer",
  "query": {
    "term": {
      "Vrvirksomhed.virksomhedMetadata.nyesteNavn.navn": "MICROSOFT DANMARK ApS"
    }
  }
}

```

But this gives me this result:

```
"hits": {
  "total": 0,
  "max_score": null,
  "hits": []
}

```

What am i missing / doing wrong here ?

---

<div class="post-metadata">

**Author:** ![jakobdo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jakobdo/32/23475_2.png) [@jakobdo](https://discuss.elastic.co/u/jakobdo)\
**Post date:** [October 26, 2017, 8:55pm UTC](https://discuss.elastic.co/t/making-a-simple-query/105471/2 "2017-10-26T20:55:42Z")

</div>

Found the answer here: [https://www.elastic.co/guide/en/elasticsearch/guide/current/\_finding\_exact\_values.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/_finding_exact_values.html)

---

<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:** [November 23, 2017, 8:56pm UTC](https://discuss.elastic.co/t/making-a-simple-query/105471/3 "2017-11-23T20:56:04Z")

</div>

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