Searching domain and subdomain returns more hits than searching for just the domain itself

Hi guys, I'm trying to make the number of hits the same when I do the queries "" and "". However when I run "", it returns less hits than "" or even just "". When I see the documents returned from searching "", it also has results of "" but less. Ideally, I would like the number of hits to be the same.

If anyone has any idea or can point me at a right direction, I would really appreciate it!


please include a fully fledged reproducable example of how you index your documents, and also how you are writing your query, as this is crucial for getting a good answer.

My first hunch would be that the queries are combined as an OR query and that you query ends up being a query for mail OR example OR com which will return more hits than example OR com - but this is all just an assumption.


Hi @spinscale, thanks for responding!

I simply indexed it using this command:
curl -XPOST -H "Content-Type: application/json" http://localhost:9200/example/1/_create -d '{"text": ""}'

The mapping is:

  "example": {
    "mappings": {
      "1": {
        "properties": {
          "text": {
            "type": "string"

If I run http://localhost:9200/_analyze? on browser, the result is:

  "tokens": [
      "token": "",
      "start_offset": 0,
      "end_offset": 16,
      "type": "<ALPHANUM>",
      "position": 0

I guess what I want to know is, is there a way for both search results to match the same documents? Should I just pre-process the query to maybe replace it with something like `*

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