0

I have an AWS ElasticSearch domain with 4 shards and 3 data nodes.

The shard 3 linked with 2 nodes: xQVLroD1RoCShwwzLwXY4g and gn9dYu4pS22gNEDeCg6RrQ.

The first query returns the expected result:

POST carat-prod/_search?preference=_shards:3|_only_nodes:xQVLroD1RoCShwwzLwXY4g
{
  "explain": true,
  "query": {
    "match_phrase_prefix": {
      "content": {
        "query": "10 Blahblahblah Avenue Apt. 42 Banana, NJ 0700"
      }
    }
  }
}

But the second one returns nothing:

POST carat-prod/_search?preference=_shards:3|_only_nodes:gn9dYu4pS22gNEDeCg6RrQ
{
  "explain": true,
  "query": {
    "match_phrase_prefix": {
      "content": {
        "query": "10 Blahblahblah Avenue Apt. 42 Banana, NJ 0700"
      }
    }
  }
}

The only difference in the queries is the specified node.

Actually, the target document contains the line (additional 1 after NJ 0700):

10 Blahblahblah Avenue Apt. 42 Banana, NJ 07001

If I try to search for

10 Blahblahblah Avenue Apt. 42 Banana, NJ 07001

I have the expected result from the both nodes.

Does anyone have any ideas why this might be so?

1 Answers1

0

Please share your index mappings and settings, without these it is very difficult to answer your question.

Some solutions:

  1. Try to refresh the index that you are querying, this may be due to a stale index.
  2. I don't know how a shard can be on two nodes at a time. A primary shard can only live on one node. Its replicas may live on other nodes, but they don't really matter in this case.
  3. A document can only live on one primary shard, so what you are probably querying are two different nodes, but the document is only present in the primary shard in one node.
  4. Did you give a node/shard preference while indexing the document?

HTH

brugia
  • 473
  • 3
  • 6