Has_child query on an alias


(Paweł Krzaczkowski) #1

Hi,

I don't know if this is a bug or it should work like that ... but it seems
like a bug.

Let's say we have monthly indexes

...
index_1405
index_1406
index_1407
...

All of them are assigned to an alias index_year - that is pointing to last
12 indexes.

We have two types

  • question
  • answer

question is a parent to answer.

Our query:

{
"min_score": 1,
"query": {
"function_score": {
"query": {
"has_child": {
"query": {
"match_all": {}
},
"score_mode" : "sum",
"type": "answer"
}
}
}
}
}

So sending this query to http://127.0.0.1:9200/index_year/_search return
records only from last index - index_1407

{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" :* 3*,
"max_score" : 4.0,
"hits" : [ ... ]
}
}

Sending this query to
http://127.0.0.1:9200/index_1405,index_1406,index_1407/_search return
results from all indxes.

{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"hits" : {
"total" : 17,
"max_score" : 4.0,
"hits" : [ .... ]
}
}

As You can see this one return 17 records .. from all indexes.

So my question is ... is there some kind of limit on has_child query and
aliases ??

Elasticsearch 1.2.1

Best ragards,
Pawel

--
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/77c62bf9-7fb5-49c0-8330-0e9c3770bf4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Paweł Krzaczkowski) #2

Hi,

My bad ... someone deleted aliases without my knowladge ... that's why it
didn't work :slight_smile: it works as it should ... the problem was with alias
definition :slight_smile:

Pawel

W dniu piątek, 11 lipca 2014 14:16:08 UTC+2 użytkownik Paweł Krzaczkowski
napisał:

Hi,

I don't know if this is a bug or it should work like that ... but it seems
like a bug.

Let's say we have monthly indexes

...
index_1405
index_1406
index_1407
...

All of them are assigned to an alias index_year - that is pointing to last
12 indexes.

We have two types

  • question
  • answer

question is a parent to answer.

Our query:

{
"min_score": 1,
"query": {
"function_score": {
"query": {
"has_child": {
"query": {
"match_all": {}
},
"score_mode" : "sum",
"type": "answer"
}
}
}
}
}

So sending this query to http://127.0.0.1:9200/index_year/_search return
records only from last index - index_1407

{
"took" : 2,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" :* 3*,
"max_score" : 4.0,
"hits" : [ ... ]
}
}

Sending this query to
http://127.0.0.1:9200/index_1405,index_1406,index_1407/_search return
results from all indxes.

{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 2,
"successful" : 2,
"failed" : 0
},
"hits" : {
"total" : 17,
"max_score" : 4.0,
"hits" : [ .... ]
}
}

As You can see this one return 17 records .. from all indexes.

So my question is ... is there some kind of limit on has_child query and
aliases ??

Elasticsearch 1.2.1

Best ragards,
Pawel

--
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/2f2da2e4-923f-4703-a5d9-7a3eca6cea63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3