Open miafgen opened 4 months ago
Searching with a PIT in a blank index (which has never had a document) returns the error 'field _id not found'".
Steps to reproduce the behavior: 1. Create the index (PUT /dalisdata_buildings) REQUEST:
--EMPTY--
RESPONSE:
{ "acknowledged": true, "shards_acknowledged": true, "index": "dalisdata_buildings" }
2. Request PIT (POST /dalisdata_buildings/_search/point_in_time?keep_alive=5m) REQUEST:
{ "pit_id": "o7OBQQETZGFsaXNkYXRhX2J1aWxkaW5ncxZneVRBenB5MlFGT3UxdzFxZDQ0NjJBABZZU2FPUGtDSlFfQ3FTMjJkMEY3LXJBAAAAAAAAAAA9FlFKV05tVjgtVDlteXplazYzNEFnUEEBFmd5VEF6cHkyUUZPdTF3MXFkNDQ2MkEAAA==", "_shards": { "total": 1, "successful": 1, "skipped": 0, "failed": 0 }, "creation_time": 1711555893091 }
3. Run first search using PIT (GET /_search) <=== The bug manifests itself in this step REQUEST:
{ "pit": { "id": "o7OBQQETZGFsaXNkYXRhX2J1aWxkaW5ncxZneVRBenB5MlFGT3UxdzFxZDQ0NjJBABZZU2FPUGtDSlFfQ3FTMjJkMEY3LXJBAAAAAAAAAAA9FlFKV05tVjgtVDlteXplazYzNEFnUEEBFmd5VEF6cHkyUUZPdTF3MXFkNDQ2MkEAAA==" }, "slice": { "id": 0, "max": 2 }, "query": { "match_all": {} }, "size": 10000 }
{ "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "field _id not found" } ], "type": "search_phase_execution_exception", "reason": "all shards failed", "phase": "query", "grouped": true, "failed_shards": [ { "shard": 0, "index": "dalisdata_buildings", "node": "YSaOPkCJQ_CqS22d0F7-rA", "reason": { "type": "illegal_argument_exception", "reason": "field _id not found" } } ], "caused_by": { "type": "illegal_argument_exception", "reason": "field _id not found", "caused_by": { "type": "illegal_argument_exception", "reason": "field _id not found" } } }, "status": 400 }
4. Add a document (PUT /dalisdata_buildings/_doc/foobar) REQUEST:
{ "foo": "bar" }
{ "_index": "dalisdata_buildings", "_id": "foobar", "_version": 1, "result": "created", "_shards": { "total": 2, "successful": 1, "failed": 0 }, "_seq_no": 0, "_primary_term": 1 }
5. Remove the previously added document (DELETE /dalisdata_buildings/_doc/foobar) REQUEST:
{ "_index": "dalisdata_buildings", "_id": "foobar", "_version": 2, "result": "deleted", "_shards": { "total": 2, "successful": 1, "failed": 0 }, "_seq_no": 1, "_primary_term": 1 }
6. Reexecute step 3 again (first search using PIT (GET /_search)) REQUEST:
{ "pit_id": "o7OBQQETZGFsaXNkYXRhX2J1aWxkaW5ncxZneVRBenB5MlFGT3UxdzFxZDQ0NjJBABZZU2FPUGtDSlFfQ3FTMjJkMEY3LXJBAAAAAAAAAAA9FlFKV05tVjgtVDlteXplazYzNEFnUEEBFmd5VEF6cHkyUUZPdTF3MXFkNDQ2MkEAAA==", "took": 12, "timed_out": false, "_shards": { "total": 1, "successful": 1, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 0, "relation": "eq" }, "max_score": null, "hits": [] } }
What is the expected behavior? The expected response on step 3 is the one received in step 6, meaning:
Summary
Searching with a PIT in a blank index (which has never had a document) returns the error 'field _id not found'".
How can one reproduce the bug?
Steps to reproduce the behavior: 1. Create the index (PUT /dalisdata_buildings) REQUEST:
RESPONSE:
2. Request PIT (POST /dalisdata_buildings/_search/point_in_time?keep_alive=5m) REQUEST:
RESPONSE:
3. Run first search using PIT (GET /_search) <=== The bug manifests itself in this step REQUEST:
RESPONSE:
4. Add a document (PUT /dalisdata_buildings/_doc/foobar) REQUEST:
RESPONSE:
5. Remove the previously added document (DELETE /dalisdata_buildings/_doc/foobar) REQUEST:
RESPONSE:
6. Reexecute step 3 again (first search using PIT (GET /_search)) REQUEST:
RESPONSE:
What is the expected behavior? The expected response on step 3 is the one received in step 6, meaning:
What is your host/environment ?