# Meaning of packages/methods with underscore prefix in java-api library

**URL:** <https://discuss.elastic.co/t/meaning-of-packages-methods-with-underscore-prefix-in-java-api-library/352295>\
**Category:** Elasticsearch\
**Created:** [February 1, 2024, 1:44pm UTC](https://discuss.elastic.co/t/meaning-of-packages-methods-with-underscore-prefix-in-java-api-library/352295 "2024-02-01T13:44:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![buitcj](https://avatars.discourse-cdn.com/v4/letter/b/a587f6/32.png) [@buitcj](https://discuss.elastic.co/u/buitcj)\
**Post date:** [February 1, 2024, 1:44pm UTC](https://discuss.elastic.co/t/meaning-of-packages-methods-with-underscore-prefix-in-java-api-library/352295/1 "2024-02-01T13:44:44Z")

</div>

Just wondering why some of method calls like the following \_toQuery(), which was found in public docs, have underscore prefixes. I also saw this in some packages like \_types. Typically I see this done for internal usage, not for public APIs so I was a bit hesitant to use these, but apparently they're found in example code so it shouldn't be a problem. That still leaves the question of why were they named like that. TIA!

From [Searching for documents | Elasticsearch Java API Client [8.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/searching.html)...

```auto
Query byName = MatchQuery.of(m -> m 
    .field("name")
    .query(searchText)
)._toQuery(); 

```

---

<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 29, 2024, 1:45pm UTC](https://discuss.elastic.co/t/meaning-of-packages-methods-with-underscore-prefix-in-java-api-library/352295/2 "2024-02-29T13:45:01Z")

</div>

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