Making a simple query

Hello,
i am new into this Elasticsearch, but i try to learn how to extract data from the danish virk.dk.
They have this 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 ?

Found the answer here: https://www.elastic.co/guide/en/elasticsearch/guide/current/_finding_exact_values.html

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