# How to benachamr single decumnt indexing

**URL:** <https://discuss.elastic.co/t/how-to-benachamr-single-decumnt-indexing/295852>\
**Category:** Elasticsearch\
**Tags:** rally\
**Created:** [January 31, 2022, 2:35pm UTC](https://discuss.elastic.co/t/how-to-benachamr-single-decumnt-indexing/295852 "2022-01-31T14:35:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marek\_duciuc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marek_duciuc/32/100189_2.png) [@marek\_duciuc](https://discuss.elastic.co/u/marek_duciuc)\
**Post date:** [January 31, 2022, 2:35pm UTC](https://discuss.elastic.co/t/how-to-benachamr-single-decumnt-indexing/295852/1 "2022-01-31T14:35:18Z")

</div>

Is this correct way how to index benchmark single document in rally?

```auto
  {
      "operation": {
        "name": "small",
        "operation-type": "bulk",
        "bulk-size": "1",
        "ingest-percentage": "1",
        "batch-size":"1000"
      },

```

---

<div class="post-metadata">

**Author:** ![json](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/json/32/4125_2.png) [@json](https://discuss.elastic.co/u/json)\
**Post date:** [January 31, 2022, 3:24pm UTC](https://discuss.elastic.co/t/how-to-benachamr-single-decumnt-indexing/295852/2 "2022-01-31T15:24:20Z")

</div>

👋 Marek, thank you for your inquiry. It is good to see you again! `ingest-percentage` is the overall percentage of the document corpus. In other words, for `ingest-percentage: 1` to load a single document, there would need to be 100 documents in the corpus since 1 is 1% of 100.

Try using `esrally` subcommand `create-track` against a cluster after having indexed the single document. Please see the [tutorial](https://esrally.readthedocs.io/en/stable/adding_tracks.html#add-track-create-track) for the steps.

---

<div class="post-metadata">

**Author:** ![marek\_duciuc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marek_duciuc/32/100189_2.png) [@marek\_duciuc](https://discuss.elastic.co/u/marek_duciuc)\
**Post date:** [January 31, 2022, 4:22pm UTC](https://discuss.elastic.co/t/how-to-benachamr-single-decumnt-indexing/295852/3 "2022-01-31T16:22:36Z")

</div>

Thank you for answer. What I want is to ingest 100k documents but each as separate index request and then using different batch sizes to see improvement in indexing thruput by using batch instead of indexing by single doc. And finally I want to test best bulk size.

---

<div class="post-metadata">

**Author:** ![json](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/json/32/4125_2.png) [@json](https://discuss.elastic.co/u/json)\
**Post date:** [January 31, 2022, 6:11pm UTC](https://discuss.elastic.co/t/how-to-benachamr-single-decumnt-indexing/295852/4 "2022-01-31T18:11:53Z")

</div>

I see and I clearly misinterpreted your question. I think you can pull off what you are trying to do with `bulk-size` and `batch-size`. Instruct Rally to read N documents from the corpus at once with the `batch-size` parameter. The `bulk-size` parameter maps to the number of documents sent to the cluster in a single bulk request, so it should provide what you want. Note you are still using the bulk API, which may or may not be in line with your use case.

You might also try executing a [`raw-request`](https://esrally.readthedocs.io/en/stable/track.html#raw-request) with N iterations in the schedule if your application uses the Elasticsearch [Index API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html) as opposed to the Bulk API. I think it would require a custom runner if you wanted to send unique documents this way.

---

<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:** [February 28, 2022, 6:12pm UTC](https://discuss.elastic.co/t/how-to-benachamr-single-decumnt-indexing/295852/5 "2022-02-28T18:12:17Z")

</div>

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