Elasticsearch / nested values (Kibana behind)


(tmanta7) #1

Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue
with the data selected.

To detail my issue, here is my structure:

{

"mappings" : {

   "fkv" : {

       "properties" : {

           "kv" : {

               "type" : "nested",

               "include_in_parent" : false,

               "properties" : {

                   "name" : {"type" : "string"},

                   "value" : {"type" : "string"}

               }

           }

       }

   }

}

}

I'm trying with Kibana to search through KV nested type. With a module I'm
generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I
don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

--
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.


(tmanta7) #2

For information, the reply from ES:

{
"took": 7,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 1,
"hits": []
},
"facets": {
"terms": {
"_type": "terms",
"missing": 3,
"total": 0,
"other": 0,
"terms": []
}
}
}

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :

Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue
with the data selected.

To detail my issue, here is my structure:

{

"mappings" : {

   "fkv" : {

       "properties" : {

           "kv" : {

               "type" : "nested",

               "include_in_parent" : false,

               "properties" : {

                   "name" : {"type" : "string"},

                   "value" : {"type" : "string"}

               }

           }

       }

   }

}

}

I'm trying with Kibana to search through KV nested type. With a module I'm
generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I
don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

--
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.


(tmanta7) #3

Pliz help :cry:

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :

Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue
with the data selected.

To detail my issue, here is my structure:

{

"mappings" : {

   "fkv" : {

       "properties" : {

           "kv" : {

               "type" : "nested",

               "include_in_parent" : false,

               "properties" : {

                   "name" : {"type" : "string"},

                   "value" : {"type" : "string"}

               }

           }

       }

   }

}

}

I'm trying with Kibana to search through KV nested type. With a module I'm
generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I
don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

--
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/876ae86c-918e-469f-808f-5c966fa48bc9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #4

What is that?

"field": "kv.key:state"

Never seen such an expression.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 26 nov. 2013 à 19:52, tmanta7@gmail.com a écrit :

Pliz help :cry:

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :

Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue with the data selected.

To detail my issue, here is my structure:

{
"mappings" : {
"fkv" : {
"properties" : {
"kv" : {
"type" : "nested",
"include_in_parent" : false,
"properties" : {
"name" : {"type" : "string"},
"value" : {"type" : "string"}
}
}
}
}
}
}

I'm trying with Kibana to search through KV nested type. With a module I'm generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

--
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/876ae86c-918e-469f-808f-5c966fa48bc9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/FB99671F-77FE-4AA3-861E-85962494D4BD%40pilato.fr.
For more options, visit https://groups.google.com/groups/opt_out.


(tmanta7) #5

Thanks for your help David.

Ok so I simplified my expression:

{
"facets": {
"terms": {
"terms": {
"field": "kv.value",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"must" : [ { "text" :
{ "kv.key" : "state"}
},
{ "text" :
{ "kv.value" : "designed"}
}
]

                }
              }
            }
          }
        }
      }
    }
  }
}

},
"size": 0
}

But it still doesn't work.
The query part works but when I'm trying to use facets I have missing
elements :confused:

I don't have any clue to improve it even in devouring the documentation

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :

Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue
with the data selected.

To detail my issue, here is my structure:

{

"mappings" : {

   "fkv" : {

       "properties" : {

           "kv" : {

               "type" : "nested",

               "include_in_parent" : false,

               "properties" : {

                   "name" : {"type" : "string"},

                   "value" : {"type" : "string"}

               }

           }

       }

   }

}

}

I'm trying with Kibana to search through KV nested type. With a module I'm
generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I
don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

--
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/8d2800b2-ee7b-4843-b1f3-6b39581606f0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #6

kv is a nested doc. I guess you should use this: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets.html#_all_nested_matching_root_documents

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 28 novembre 2013 at 08:42:27, tmanta7@gmail.com (tmanta7@gmail.com) a écrit:

Thanks for your help David.

Ok so I simplified my expression:

{
"facets": {
"terms": {
"terms": {
"field": "kv.value",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"must" : [ { "text" :
{ "kv.key" : "state"}
},
{ "text" :
{ "kv.value" : "designed"}
}
]

                }
              }
            }
          }
        }
      }
    }
  }
}

},
"size": 0
}

But it still doesn't work.
The query part works but when I'm trying to use facets I have missing elements :confused:

I don't have any clue to improve it even in devouring the documentation

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :
Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue with the data selected.

To detail my issue, here is my structure:

{
"mappings" : {
"fkv" : {
"properties" : {
"kv" : {
"type" : "nested",
"include_in_parent" : false,
"properties" : {
"name" : {"type" : "string"},
"value" : {"type" : "string"}
}
}
}
}
}
}

I'm trying with Kibana to search through KV nested type. With a module I'm generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

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/8d2800b2-ee7b-4843-b1f3-6b39581606f0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/etPan.5296fdf2.7724c67e.3e14%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/groups/opt_out.


(tmanta7) #7

Ok I'm really near of the solution I feel it :slight_smile:

{
"facets": {
"terms": {
"terms_stats": {
"key_field" : "kv.value",
"value_field" : "???"
},
"nested": "kv",
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"must" : [ { "text" :
{ "kv.key" : "state"}
},
{ "text" :
{ "kv.value" : "designed"}
}
]

                }
              }
            }
          }
        }
      }
    }
  }
}

},
"size": 0
}

But I just want to modify the value field to not count my kv.value but only
the number of occurences returned by my filter!
Is there any function for that?

Thanks for your help!

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :

Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue
with the data selected.

To detail my issue, here is my structure:

{

"mappings" : {

   "fkv" : {

       "properties" : {

           "kv" : {

               "type" : "nested",

               "include_in_parent" : false,

               "properties" : {

                   "name" : {"type" : "string"},

                   "value" : {"type" : "string"}

               }

           }

       }

   }

}

}

I'm trying with Kibana to search through KV nested type. With a module I'm
generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I
don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

--
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/39cbd500-6075-4de0-96cc-24c5f6d7f089%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #8

In that case you could probably use a filter facets?

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-filter-facet.html#search-facets-filter-facet

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 28 novembre 2013 at 10:51:05, tmanta7@gmail.com (tmanta7@gmail.com) a écrit:

Ok I'm really near of the solution I feel it :slight_smile:

{
"facets": {
"terms": {
"terms_stats": {
"key_field" : "kv.value",
"value_field" : "???"
},
"nested": "kv",
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"must" : [ { "text" :
{ "kv.key" : "state"}
},
{ "text" :
{ "kv.value" : "designed"}
}
]

                }
              }
            }
          }
        }
      }
    }
  }
}

},
"size": 0
}

But I just want to modify the value field to not count my kv.value but only the number of occurences returned by my filter!
Is there any function for that?

Thanks for your help!

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :
Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue with the data selected.

To detail my issue, here is my structure:

{
"mappings" : {
"fkv" : {
"properties" : {
"kv" : {
"type" : "nested",
"include_in_parent" : false,
"properties" : {
"name" : {"type" : "string"},
"value" : {"type" : "string"}
}
}
}
}
}
}

I'm trying with Kibana to search through KV nested type. With a module I'm generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

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/39cbd500-6075-4de0-96cc-24c5f6d7f089%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/etPan.52971724.649bb77c.3e14%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/groups/opt_out.


(tmanta7) #9

Ok I understand. So for my need, I will have to combine the use of facet
filter and filter facets:

{
"facets": {
"my_filter": {
"filter": {
"term" : { "kv.key" : "state" }
},
"nested": "kv",
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"must" : [ { "text" :
{ "kv.key" : "state"}
},
{ "text" :
{ "kv.value" : "designed"}
}
]

                }
              }
            }
          }
        }
      }
    }
  }
}

But it still does not work. I don't understand how to combine that...

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :

Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue
with the data selected.

To detail my issue, here is my structure:

{

"mappings" : {

   "fkv" : {

       "properties" : {

           "kv" : {

               "type" : "nested",

               "include_in_parent" : false,

               "properties" : {

                   "name" : {"type" : "string"},

                   "value" : {"type" : "string"}

               }

           }

       }

   }

}

}

I'm trying with Kibana to search through KV nested type. With a module I'm
generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I
don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

--
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/f72b9b24-71b5-4339-8ac1-6d0b656dc0e6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #10

Yes probably your solution is here.

It could help a lot if you recreate a full test case and gist it.

Something similar to: https://gist.github.com/dadoonet/7698308

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 28 novembre 2013 at 11:38:03, tmanta7@gmail.com (tmanta7@gmail.com) a écrit:

Ok I understand. So for my need, I will have to combine the use of facet filter and filter facets:

{
"facets": {
"my_filter": {
"filter": {
"term" : { "kv.key" : "state" }
},
"nested": "kv",
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"must" : [ { "text" :
{ "kv.key" : "state"}
},
{ "text" :
{ "kv.value" : "designed"}
}
]

                }
              }
            }
          }
        }
      }
    }
  }
}

But it still does not work. I don't understand how to combine that...

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :
Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue with the data selected.

To detail my issue, here is my structure:

{
"mappings" : {
"fkv" : {
"properties" : {
"kv" : {
"type" : "nested",
"include_in_parent" : false,
"properties" : {
"name" : {"type" : "string"},
"value" : {"type" : "string"}
}
}
}
}
}
}

I'm trying with Kibana to search through KV nested type. With a module I'm generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

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/f72b9b24-71b5-4339-8ac1-6d0b656dc0e6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/etPan.5297b67a.5fb8370b.3e14%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/groups/opt_out.


(G.Sanchez) #11

Hi David,

Excuse me but I did not understand your example...
you have to put this one: https://gist.github.com/dadoonet/7698308 in a
"script":[...] field ?

thx

G.Sanchez

Le jeudi 28 novembre 2013 22:32:42 UTC+1, David Pilato a écrit :

Yes probably your solution is here.

It could help a lot if you recreate a full test case and gist it.

Something similar to: https://gist.github.com/dadoonet/7698308

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet https://twitter.com/dadoonet | @elasticsearchfrhttps://twitter.com/elasticsearchfr

Le 28 novembre 2013 at 11:38:03, tma...@gmail.com <javascript:> (
tma...@gmail.com <javascript:>) a écrit:

Ok I understand. So for my need, I will have to combine the use of facet
filter and filter facets:

{
"facets": {
"my_filter": {
"filter": {
"term" : { "kv.key" : "state" }
},
"nested": "kv",
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"must" : [ { "text" :
{ "kv.key" : "state"}
},
{ "text" :
{ "kv.value" : "designed"}
}
]

                }
              }
            }
          }
        }
      }
    }
  }
}

But it still does not work. I don't understand how to combine that...

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :

Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue
with the data selected.

To detail my issue, here is my structure:

{

"mappings" : {

   "fkv" : {

       "properties" : {

           "kv" : {

               "type" : "nested",

               "include_in_parent" : false,

               "properties" : {

                   "name" : {"type" : "string"},

                   "value" : {"type" : "string"}

               }

           }

       }

   }

}

}

I'm trying with Kibana to search through KV nested type. With a module
I'm generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'.
I don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/f72b9b24-71b5-4339-8ac1-6d0b656dc0e6%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/3d0e409b-1328-4f25-a7c8-9037f6b09266%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #12

Hi G! :slight_smile:

My gist was just an example of a GIST we can work with. It was not related to the use case described in this thread.
It was just another illustration of this page: http://www.elasticsearch.org/help/

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 4 décembre 2013 at 11:19:54, G.Sanchez (gs.tribu@gmail.com) a écrit:

Hi David,

Excuse me but I did not understand your example...
you have to put this one: https://gist.github.com/dadoonet/7698308 in a "script":[...] field ?

thx

G.Sanchez

Le jeudi 28 novembre 2013 22:32:42 UTC+1, David Pilato a écrit :
Yes probably your solution is here.

It could help a lot if you recreate a full test case and gist it.

Something similar to: https://gist.github.com/dadoonet/7698308

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr

Le 28 novembre 2013 at 11:38:03, tma...@gmail.com (tma...@gmail.com) a écrit:

Ok I understand. So for my need, I will have to combine the use of facet filter and filter facets:

{
"facets": {
"my_filter": {
"filter": {
"term" : { "kv.key" : "state" }
},
"nested": "kv",
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"must" : [ { "text" :
{ "kv.key" : "state"}
},
{ "text" :
{ "kv.value" : "designed"}
}
]

                }
              }
            }
          }
        }
      }
    }
  }
}

But it still does not work. I don't understand how to combine that...

Le jeudi 21 novembre 2013 19:28:36 UTC+1, tma...@gmail.com a écrit :
Hello guys,

I'm working to integrate nested values in Kibana but I'm facing an issue with the data selected.

To detail my issue, here is my structure:

{
"mappings" : {
"fkv" : {
"properties" : {
"kv" : {
"type" : "nested",
"include_in_parent" : false,
"properties" : {
"name" : {"type" : "string"},
"value" : {"type" : "string"}
}
}
}
}
}
}

I'm trying with Kibana to search through KV nested type. With a module I'm generating the following request:

{
"facets": {
"terms": {
"terms": {
"field": "kv.key:state",
"size": 10,
"order": "count",
"exclude": []
},
"facet_filter": {
"fquery": {
"query": {
"filtered": {
"query": {
"nested": {
"path": "kv",
"query": {
"bool": {
"should": [
{
"query_string": {
"query": "*"
}
}
]
}
}
}
},
"filter": {
"bool": {
"must": [
{
"match_all": {}
},
{
"bool": {
"must": [
{
"match_all": {}
}
]
}
}
]
}
}
}
}
}
}
}
},
"size": 0
}

I'm matching some fields but unfortunately I have just 'missing fields'. I don't know how to solve this problem :frowning:

Thanks for your help

PS: I someone is interested in my JS code I could provide the source

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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f72b9b24-71b5-4339-8ac1-6d0b656dc0e6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

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/3d0e409b-1328-4f25-a7c8-9037f6b09266%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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/etPan.529f0284.54e49eb4.bd3d%40MacBook-Air-de-David.local.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #13