Fetching PhaseFreq of a Span Near query


(Sruthi Nagalla) #1

Hi,
I have a span near query which returns certain result. Now I want to extract the tf/phasefreq. I don't want to parse. I am looking at writing a dynamic script (Groovy) to fetch it. So far I am not successful.
Below is how the result looks like in explanation field and I want to fetch phraseFreq=0.33333334:
"_explanation": {
"value": 0.03321779,
"description": "weight(spanNear([text:really, text:nice], 0, true) in 0) [PerFieldSimilarity], result of:",
"details": [
{
"value": 0.03321779,
"description": "fieldWeight in 0, product of:",
"details": [
{
"value": 0.57735026,
"description": "tf(freq=0.33333334), with freq of:",
"details": [
{
"value": 0.33333334,
"description": "phraseFreq=0.33333334"
}
]
},


(system) #2