Class ElasticsearchCollectionValueToStringConverter

java.lang.Object
org.springframework.data.elasticsearch.repository.support.value.ElasticsearchCollectionValueToStringConverter
All Implemented Interfaces:
GenericConverter

public class ElasticsearchCollectionValueToStringConverter extends Object implements GenericConverter
Convert a collection into string for value part of the elasticsearch query.

If the value is type String, it should be wrapped with square brackets, with each element quoted therefore escaped(by ElasticsearchStringValueToStringConverter) if quotations exist in the original element.

eg: The value part of an elasticsearch terms query should looks like ["hello \"Stranger\"","Another string"] for query

 
  {
    "bool":{
      "must":{
        "terms":{
          "name": ["hello \"Stranger\"", "Another string"]
        }
      }
    }
  }
 
 
Since:
5.3
Author:
Haibo Liu