Mapping parent-child relationships in plugin for ElasticSearch


#1

Hi,
I am unsuccessful with creation parent-child relation of 2 documents (2-nd document: counter).
What I am doing wrong ?
Thanks!


Following the documents example:

aggregation_meta
"aggregation_meta_14e6a0506be-15_1_2_1450195320000":{
“cpm”: 1.5,
“event_type”: 1,
“saved”: false,
“created_at_millis”: 1450196161819,
“created_at”: “2015-12-15T16:16:01.819Z”,
“tag_id”: “14e6a0506be-15”,
“aggregation”: 2,
“type”: “aggregation_meta”,
“timescale”: 1450195320000,
“counter_id”: “14e6a0506be-15_1_2_1450195320000”,
“status”: 0
}

aggrtegation_counter
"aggrtegation_counter_14e6a0506be-15_1_2_1450195320000":1


Following the config:
couchbase.wrapCounters: true
couchbase.keyFilter: org.elasticsearch.transport.couchbase.capi.RegexKeyFilter
couchbase.keyFilter.type: include
couchbase.keyFilter.keyFiltersRegex.aggregation_counter: ^aggregation_counter_[1-9].$
couchbase.keyFilter.keyFiltersRegex.aggregation_meta: ^aggregation_meta_[1-9].
$
couchbase.parentSelector.documentTypeParentFields.aggregation_meta: doc.counter_id
couchbase.parentSelector.documentTypesParentRegex.aggregation_counter: ^aggregation_counter_(?<parent>.+)


#2

you can see also:
http://developer.couchbase.com/documentation/server/4.0/connectors/elasticsearch-2.1/adv-usage.html
From my test, you should config:

  1. define parentSelector
couchbase.parentSelector as org.elasticsearch.transport.couchbase.capi.DefaultParentSelector 

for example;
2. Mapping parent-child relationships

couchbase.parentSelector.documentTypeParentFields.aggregation_meta: doc.counter_id

for example;
3. Specifying custom document routing
If you have multilayer parent-child relationships.
4. define _parent in template mapping maybe


#3
  1. if i did’n mistaken, DefaultParentSelector -> selected by default, so not required to select it. Anyway this is not helped.

  2. couchbase.parentSelector.documentTypeParentFields - already defined

  3. Custom document routing not relevant for counter. So I try to rout between the documents with config:

couchbase.parentSelector.documentTypesParentFormat.aggregation_meta: aggregation_counter_<parent>
-> Not helped. (This is new property in 2.2)