I have in my mapping a field called "topics" with type "object". Each doc
have one or many fields "topic.t1", "topic.t8" etc, whose value are 0 or 1.
But all docs don't have the same subfields.
Now i'd like to use a script to sort in this kind of way :
"(doc['topic.t1'].value > 0 || doc['topic.t4'].value > 0 ||
doc['topic.t7'].value > 0) ? 1 : 0" DESC
But i saw in the documentation that "the doc notation only allows for
simple valued fields".
So is there another way to do that ?
Thanks in advance for your help.
I hope I clearly exposed my problem, as I'm new to ElasticSearch.
Le mardi 24 février 2015 15:52:49 UTC+1, Christophe Rosko a écrit :
Hi !
I have in my mapping a field called "topics" with type "object". Each doc
have one or many fields "topic.t1", "topic.t8" etc, whose value are 0 or 1.
But all docs don't have the same subfields.
Now i'd like to use a script to sort in this kind of way :
"(doc['topic.t1'].value > 0 || doc['topic.t4'].value > 0 ||
doc['topic.t7'].value > 0) ? 1 : 0" DESC
But i saw in the documentation that "the doc notation only allows for
simple valued fields".
So is there another way to do that ?
Thanks in advance for your help.
I hope I clearly exposed my problem, as I'm new to Elasticsearch.
Le mardi 24 février 2015 15:52:49 UTC+1, Christophe Rosko a écrit :
Hi !
I have in my mapping a field called "topics" with type "object". Each doc
have one or many fields "topic.t1", "topic.t8" etc, whose value are 0 or 1.
But all docs don't have the same subfields.
Now i'd like to use a script to sort in this kind of way :
"(doc['topic.t1'].value > 0 || doc['topic.t4'].value > 0 ||
doc['topic.t7'].value > 0) ? 1 : 0" DESC
But i saw in the documentation that "the doc notation only allows for
simple valued fields".
So is there another way to do that ?
Thanks in advance for your help.
I hope I clearly exposed my problem, as I'm new to 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.