Last active
December 16, 2015 14:09
-
-
Save pulkitsinghal/5447250 to your computer and use it in GitHub Desktop.
Multivalue field and facet query - unexpected results...
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
properties: { | |
id: { | |
type: string | |
}, | |
name: { | |
type: string | |
}, | |
bought_together: { | |
dynamic: true, | |
properties: { | |
id: { | |
type: string | |
}, | |
name: { | |
type: string | |
} | |
} | |
} | |
} |
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
dummy_index_4: { | |
sale: { | |
properties: { | |
bought_together: { | |
type: nested | |
properties: { | |
id: { | |
type: string | |
} | |
name: { | |
type: string | |
} | |
} | |
} | |
id: { | |
type: string | |
} | |
name: { | |
type: string | |
} | |
} | |
} | |
} |
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
{ | |
id: 6, | |
name: Bread, | |
bought_together: [ | |
{ | |
id: 7, | |
name: Cheese | |
}, | |
{ | |
id: 8, | |
name: Eggs | |
}, | |
{ | |
id: 8, | |
name: Eggs | |
}, | |
{ | |
id: 7, | |
name: Cheese | |
} | |
] | |
} |
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
{ | |
"query": { | |
"text": { | |
"name": "BrEaD" | |
} | |
}, | |
"facets": { | |
"tag": { | |
"terms": { | |
"field": "bought_together.name", | |
"size": 10 | |
} | |
} | |
} | |
} |
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
facets: { | |
tag: { | |
_type: terms, | |
missing: 0, | |
total: 2, | |
other: 0, | |
terms: [ | |
{ | |
term: eggs, | |
count: 1 | |
}, | |
{ | |
term: cheese, | |
count: 1 | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment