I am migrating from 2.x to 5.x I am adding values to the index like this
indexInto (indexName / indexType) id someKey source foo
however I would also want to fetch all values by field:
def getValues(tag: String) ={
client execute {
search(indexName / indexType) query ("_field_names", tag) aggregations (termsAggregation( "agg") field tag size 1)
}
But I am getting this exception :
RemoteTransportException[[8vWOLB2][172.17.0.5:9300][indices:data/read/search[phase/query]]]; nested: IllegalArgumentException[Fielddata is disabled on text fields by default. Set fielddata=true on [my_tag] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory.];
I am thought maybe to use keyword
as shown here , but the fields are not known in advanced (sent by the user) so I cannot use perpend mappings