# Newly inserted document not visible in searches

**URL:** <https://discuss.elastic.co/t/newly-inserted-document-not-visible-in-searches/265734>\
**Category:** Elasticsearch\
**Created:** [February 28, 2021, 6:30pm UTC](https://discuss.elastic.co/t/newly-inserted-document-not-visible-in-searches/265734 "2021-02-28T18:30:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cesidio\_DiBenedetto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cesidio_dibenedetto/32/78869_2.png) [@Cesidio\_DiBenedetto](https://discuss.elastic.co/u/Cesidio_DiBenedetto)\
**Post date:** [February 28, 2021, 6:30pm UTC](https://discuss.elastic.co/t/newly-inserted-document-not-visible-in-searches/265734/1 "2021-02-28T18:30:28Z")

</div>

PUT [https://elasticsearch-url/index-name/\_doc/customID?refresh](https://elasticsearch-url/index-name/_doc/customID?refresh)

```auto
{
my data object
}

```

This is the response I get:

```auto
{
  "_index": "index-name",
  "_type": "_doc",
  "_id": "customID",
  "_version": 1,
  "result": "created",
  "forced_refresh": true,
  "_shards": {
    "total": 2,
    "successful": 2,
    "failed": 0
  },
  "_seq_no": 204514,
  "_primary_term": 1
}

```

I do have:

```auto
  "index.refresh_interval": "1s",
  "index.write.wait_for_active_shards": "1"

```

I can query it by customID but not through a search. Can't seem to figure out why?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [February 28, 2021, 6:33pm UTC](https://discuss.elastic.co/t/newly-inserted-document-not-visible-in-searches/265734/2 "2021-02-28T18:33:31Z")

</div>

The json object you posted is invalid.

```
{
my data object
}

```

Can you show the results when you query it by `customID`

And how you are trying to perform the search

---

<div class="post-metadata">

**Author:** ![Cesidio\_DiBenedetto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cesidio_dibenedetto/32/78869_2.png) [@Cesidio\_DiBenedetto](https://discuss.elastic.co/u/Cesidio_DiBenedetto)\
**Post date:** [February 28, 2021, 7:23pm UTC](https://discuss.elastic.co/t/newly-inserted-document-not-visible-in-searches/265734/3 "2021-02-28T19:23:20Z")

</div>

Stephen,

My bad. Maybe because it's Sunday, but one of the parameters I was searching against was wrong. Default value is 'A' for the search query, but for that document, the value was 'U', thus never returning. I think I need a coffee or two.

Sorry for the inconvenience.

Sid.

---

<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:** [March 28, 2021, 7:23pm UTC](https://discuss.elastic.co/t/newly-inserted-document-not-visible-in-searches/265734/4 "2021-03-28T19:23:39Z")

</div>

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