Min_Cha
(Min Cha)
November 21, 2013, 8:11am
1
Hello all.
I have a question.
For example, there are documents as following.
Love is blue.
Blue is love.
Red is not love.
In this case if I apply indexOf('Love'), result is as following.
Love is blue = index 0
Love is blue = index 8
Love is blue = index 12
Finally, I would like to compute score like following pseudo syntax.
script : "_score * sentence.indexOf(keyword)"
In ElasticSearch, is this possible?
Please give me some advice.
Thanks for reading.
--
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 elasticsearch+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
Min_Cha
(Min Cha)
November 22, 2013, 3:09am
2
Hello.
I have resolved this issue.
Following is a example to resolve my problem.
{"query":{"custom_score":{"query":{"query_string":{"query":"title:"Love""}},"script":"_source.weight
new String(_source.title).indexOf("Love") * 0.00001"}}}
2013년 11월 21일 목요일 오후 5시 11분 53초 UTC+9, Min Cha 님의 말:
Hello all.
I have a question.
For example, there are documents as following.
Love is blue.
Blue is love.
Red is not love.
In this case if I apply indexOf('Love'), result is as following.
Love is blue = index 0
Love is blue = index 8
Love is blue = index 12
Finally, I would like to compute score like following pseudo syntax.
script : "_score * sentence.indexOf(keyword)"
In Elasticsearch, is this possible?
Please give me some advice.
Thanks for reading.
--
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 elasticsearch+unsubscribe@googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .