# Does version 7.2.2Final allow for OpenSearch match\_only\_text Field?

**URL:** <https://discourse.hibernate.org/t/does-version-7-2-2final-allow-for-opensearch-match-only-text-field/11165>\
**Category:** Hibernate Search\
**Created:** [March 6, 2025, 7:52pm UTC](https://discourse.hibernate.org/t/does-version-7-2-2final-allow-for-opensearch-match-only-text-field/11165 "2025-03-06T19:52:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![simi](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@simi](https://discourse.hibernate.org/u/simi)\
**Post date:** [March 6, 2025, 7:52pm UTC](https://discourse.hibernate.org/t/does-version-7-2-2final-allow-for-opensearch-match-only-text-field/11165/1 "2025-03-06T19:52:59Z")

</div>

I’m looking at moving one of our applications to the following:

- Spring-Boot 3.4.2
- Hibernate Search 7.2.2.Final
- AWS OpenSearch 2.15 (from OS 1.2)

I came across [this article](https://opensearch.org/blog/Optimize-storage-and-performance-using-MatchOnlyText-field/) on the the OpenSearch `match_only_text` field introduced in version 2.12.

Is there any method of mapping my standard java String mappings of `GenericField`, `KeywordField`, `FullTextField` types to leverage this (in the cases where it makes sense)? I’ve not seen any other examples other than some references to the hibernate `@NonStandardardField` annotation that I can’t seem to figure out how to use for this. Or even if that’s something I should be using.

Anyone know if this is feasible?

Honestly - I don’t have that much of a care on storage size gains by using this field - but rather any performance gains on searching on this type of field. If that’s super minimal - then this really may not be worth my time regardless.

Thanks for any suggestions or insight!

---

<div class="post-metadata">

**Author:** ![mbekhta](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mbekhta/32/2044_2.png) [@mbekhta](https://discourse.hibernate.org/u/mbekhta)\
**Post date:** [March 7, 2025, 9:14am UTC](https://discourse.hibernate.org/t/does-version-7-2-2final-allow-for-opensearch-match-only-text-field/11165/2 "2025-03-07T09:14:12Z")

</div>

hey @simi ,

[Custom index mapping](https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#backend-elasticsearch-mapping-custom) is what you might be looking for. You could try defining the property configuration in the json:

```json
{
  "properties":{
    "someField":{
      "type":"match_only_text"
    }
}

```

and then pass it to Hibernate Seach through the `hibernate.search.backend.indexes.<index-name>.schema_management.settings_file` configuration property.

> [@simi](#):
>
> Anyone know if this is feasible?

their documentation suggests that it can improve performance in some cases, but I haven’t really tried this field type in the past. In the end it all comes down to your particular use case and load, so you probably should just give it a try and measure some performance metrics to compare and make a decision 🙂.

---

<div class="post-metadata">

**Author:** ![simi](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@simi](https://discourse.hibernate.org/u/simi)\
**Post date:** [March 7, 2025, 1:17pm UTC](https://discourse.hibernate.org/t/does-version-7-2-2final-allow-for-opensearch-match-only-text-field/11165/3 "2025-03-07T13:17:59Z")

</div>

I appreciate the quick response! I’ll have to take a gander at that option.
