I'd like to do an exact search for entity field that has "xx-xx-xx" format.
The entity looks as follows:
@Entity
@Indexed
class Resource {
@Field
private String address; // has "xx-xx-xx" format
}
The query creation process is as follows:
queryBuilder.keyword().onFields("resource").matching(searchQuery).createQuery()
Suppose I have two resources with the following addresses:
aa-bb-cc
cc-dd-ee
When I run a search query "aa-bb-cc" I expect that only the first resource will be returned, but instead, I have the search returns both resources.
What should I change to do and exact search by resource field?