I have a users index in that there is a field called groupName that have value like "ad-users" when I query to match how many users belong to "ad-users" groupName. Upon querying to match on groupName I got no results. Here is my query
The document I mention above is one of the many users. That doc does not have isServiceAccount field but there are many others docs which have isServiceAccount .
memberOf.groupName is a multi-field and if you use memberOf.groupName, it is of type text. The default analyser being used is the standard analyzer which removes punctuation (so the - character is being removed during tokenisation). You can verify the same by using the analyze API. For example:
GET /_analyze
{
"analyzer" : "standard",
"text" : "ad-users"
}
If you want to perform an exact match, then you will need to use memberOf.groupName.keyword (keyword fields are not analysed). Otherwise, you will need to use a different analyser to meet your requirements.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.