Nested mapping strategy


(Vinicius Carvalho) #1

Hi there! I'm choosing between a single index with a nested object or
splitting it on several index, and flatten the object. In the past using
Solr and Lucene I followed the flatten strategy, but ES seems to be really
powerful in handling complex json objects.

One issue I could not figure yet is how you would tell which field was
found when a doc was hit using a nested strategy. For instance:

{
id:14567
artist : {
name: Iron Maiden
albums: [
{
album: {
name:Powerslave
tracks: [
{
track: { name: Powerslave
...}}}

So, when a user searches for Powerslave it would find the document 14567,
which is the artist Iron Maiden, but I'd like to suggest that it found an
album and a song named Powerslave. Is there an easy way of doing this? Or
flattening and doing a multi index search would be a better approach?

Regards


(system) #2