-
-
Save markharwood/fec539e954dfffe162af8817b962ffa1 to your computer and use it in GitHub Desktop.
Collapsing Inner hits "from:1" issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test for PR 22337 | |
// This only fails if number_of_shards ==1 | |
DELETE test | |
PUT test | |
{ | |
"settings":{ | |
"number_of_shards": 1 | |
}, | |
"mappings": { | |
"article": { | |
"properties": { | |
"domain": { | |
"type": "keyword" | |
}, | |
"tweets": { | |
"type": "integer" | |
}, | |
"title": { | |
"type": "text" | |
} | |
} | |
} | |
} | |
} | |
POST test/article | |
{ | |
"domain":"site1", | |
"tweets":10, | |
"title":"story 1" | |
} | |
POST test/article | |
{ | |
"domain":"site1", | |
"tweets":20, | |
"title":"story 2" | |
} | |
POST test/article | |
{ | |
"domain":"site1", | |
"tweets":30, | |
"title":"story 3" | |
} | |
POST test/article | |
{ | |
"domain":"site2", | |
"tweets":20, | |
"title":"story 4" | |
} | |
// This use of "from" does not de-dup as expected - first inner same as root | |
GET test/article/_search?q=story | |
{ | |
"collapse": { | |
"field": "domain", | |
"inner_hits": { | |
"name": "collapsed_hits", | |
"size": 3, | |
"from":1 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment