# Elastic Search explain query to get tf and idf values

**URL:** <https://discuss.elastic.co/t/elastic-search-explain-query-to-get-tf-and-idf-values/106960>\
**Category:** Elasticsearch\
**Created:** [November 9, 2017, 4:11am UTC](https://discuss.elastic.co/t/elastic-search-explain-query-to-get-tf-and-idf-values/106960 "2017-11-09T04:11:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ESlearner](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@ESlearner](https://discuss.elastic.co/u/ESlearner)\
**Post date:** [November 9, 2017, 4:11am UTC](https://discuss.elastic.co/t/elastic-search-explain-query-to-get-tf-and-idf-values/106960/1 "2017-11-09T04:11:09Z")

</div>

Hello - I created a java function to compute the TF/IDF values . Can I request help to check my explain part as I get an compile and syntax error for the below request to ES.

#!/bin/bash

curl -XGET 'localhost:9200/mytask/myindex/\_validate/query?explain'  
{  
"query" : {  
"match": {  
"title": "xxxx" }  
}  
}'

---

<div class="post-metadata">

**Author:** ![ESlearner](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@ESlearner](https://discuss.elastic.co/u/ESlearner)\
**Post date:** [November 9, 2017, 4:25am UTC](https://discuss.elastic.co/t/elastic-search-explain-query-to-get-tf-and-idf-values/106960/2 "2017-11-09T04:25:24Z")

</div>

Here is the error message:  
line 7 : unexpected EOF while expecting ' ` '.  
line 8 : syntax error unexpected end of file

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 7, 2017, 4:25am UTC](https://discuss.elastic.co/t/elastic-search-explain-query-to-get-tf-and-idf-values/106960/3 "2017-12-07T04:25:28Z")

</div>

Closed on December 7, 2017, 4:25am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
