Hello. I'm creating an Elasticsearch plugin that creates a new field type 
(similarly to how the elastic-mapper-attachments plugin does here 
<https://github.com/elasticsearch/elasticsearch-mapper-attachments/blob/master/src/main/java/org/elasticsearch/index/mapper/attachment/AttachmentMapper.java>).
 
However, I need to store sub-objects and several instances of a nested 
object. For instance, for a type mapping like this:

{
    "my_elastic_type": {
        "properties": {
            "my_field": {
                "type": "my_new_field_type",
                "stuff": {
                    "reference": {
                        "index": "myIndex",
                        "type": "ref",
                    }
                },
                "stuff2": {
                    "reference": {
                        "index": "myOtherIndex",
                        "type": "ref",
                    }
                }
            }
        }
    }
}

and indexing a document like this:
{
    "my_field": "text here"
}

I would like the store the equivalent to the following in the index:
{
    "stuff": {
        "calcField1": "foo",
        "calcField2": "baz",
        "nestedObjs": [
            {
                 "nestedField1": "info",
                 "nestedField2": "data"
            },
            {
                 "nestedField1": "info",
                 "nestedField2": "data"
            }
        ]
    },
    "stuff2": {
        "calcField1": "foo2",
        "calcField2": "baz2",
        "nestedObjs": [
            {
                 "nestedField1": "info2",
                 "nestedField2": "data2"
            },
            {
                 "nestedField1": "info2",
                 "nestedField2": "data2"
            }
        ]
    },
}

I'm having a lot of trouble figuring out how to add non-simple fields in my 
plugin. I can't find any documentation of how to develop an Elasticsearch 
plugin.

Thanks for any help.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/9854898a-93ab-46f0-a52c-4dc6070aa35b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to