Elasticsearch output format with "head" plugin


(Prashant Agrawal) #1

Hi All,

I am using head plugin to access the elastic search through GUI and cluster plugin to cluster the data.
So is there anyway I can display any particular field in GUI of elasticsearch.
For ex:
If my query is
{
"search_request": {
"fields": [
"Content"
],
"query": {
"match": {
"_all": "mobile"
}
}
},
"field_mapping": {
"content": [
"fields.Content"
]
},
}

And response will be everything as took, size, data, label, clusters, phrases etc.

So is there any way I can display only label/cluster in elasticsearch GUI with the help of any other plugin or other way out.


(Prashant Agrawal) #2

Any help for the same issue?


(Binh Ly-2) #3

If you're doing a _search on the "Any Request" tab in head, there is a
Result Transformer section at the bottom of your search query. In there you
can write a simple transform script. For example, the following script
displays only the took and the hits values:

return { took: root.took, hits: root.hits.hits };

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8f05e015-3db9-4eaa-aa50-790647c59b1b%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Prashant Agrawal) #4

Hi Binh,

Actually I did the same but the problem is I want to fetch multiple record.

For ex.

  1. There is query which returns multiple clusters and that clusters have labels.
  2. Now I want to fetch the label from all clusters .
  3. So if I am writing the query like return { label:root.clusters[0].label};
  4. It will return the label for cluster 0.
  5. But I want the label from all clusters so how I can achieve that?

(system) #5