DataTable in json


(Ahmed HADDAD) #1

Hello,I'm going to use elasticsearch with php so i need to make some queries using json.0
i've searched throw the documentation but i didn't find how to make a datatable using json.


(David Pilato) #2

What is a datatable? Could you give an example of what you are looking for?


(Ahmed HADDAD) #3

in kibana visulasation you can create a Data Table that creates a Table where the columns are the fields of the index.
i want to do the same but with php


(Ahmed HADDAD) #4

what i want is to get for example the first field and to diplay it all.
then i can put it in a column of a table


(Ahmed HADDAD) #5

I found the solution but i still need to add a filter

GET /_search
{
    "size":10,
    "query": {  
        "type" : {
            "value" : "project"
       }
    }
}

(Ahmed HADDAD) #6

Solved , i found that for elasticsearch 5.x and 6 i need a bool filter:

   "query": {
          "bool": {
               "filter": {
                    "term": {
                       "column4": "error"
                                                   }
                                     }
                               }
                        }

(system) #7

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