Hello,
Length of string is 5 , but why is it returning 3 by counting only unique characters ?
Same with words in a string
Hello,
Length of string is 5 , but why is it returning 3 by counting only unique characters ?
Same with words in a string
Hi @Pranusha119,
try doc['special_char.keyword'].value.length()
Let me know if that's what you expect to get.
Oh ok, sorry, I didn't understand your question before – unfortunately, to my knowledge you cannot do it – once you index your field as keyword, it will only count unique values. Maybe you could add a string field at indexing time that would store all the characters as a string and then you could print out the string length?
I don't have any other ideas, maybe someone else has.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
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.