Does version 7.2.2Final allow for OpenSearch match_only_text Field?

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 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!

hey @simi ,

Custom index mapping is what you might be looking for. You could try defining the property configuration in the 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.

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 :slightly_smiling_face:.

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