Can _search_with_cluster also cluster the result if content is of type "attachment"?

(Pratikshya Kuinkel) #1

You won't be able to cluster the base64 encoded string directly. But, if you specify "fields" when firing your query, you will be able to do that. Please have a look at the following gist:

You will now be able to use files.file when clustering your result. However, if you have an array of attachments, it will treat all the files as a single file when clustering. Only way we can access them as array is through _source, which again will only return base64 encoded string. Not sure how to get around this issue. But for single files, using "field_mapping": { "title":[fields.files.file"]} should work. Let me know how it goes.

You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit

(system) #2