Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_parent mapping #567

Open
scne opened this issue Oct 20, 2015 · 0 comments
Open

_parent mapping #567

scne opened this issue Oct 20, 2015 · 0 comments

Comments

@scne
Copy link

scne commented Oct 20, 2015

Hi everybody,

I've 3 collections in my database under mongo: shows - venues - dropdowns

shows are mapped like below
{"shows": { "properties" : { "description": { "type": "string" }, "image": { "type": "string" }, "site": { "type": "string" }, "title" : { "type" : "multi_field", "fields" : { "title" : {"type" : "string", "index" : "analyzed"}, "raw_title" : {"type" : "string", "index" : "not_analyzed", "store": "no"} } } } }

venues like this

{ "venues": { "properties" : { "name" : { "type" : "multi_field", "fields" : { "name" : {"type" : "string", "index" : "analyzed"}, "raw_name" : {"type" : "string", "index" : "not_analyzed", "store": "no"} } }, "city" : { "type" : "multi_field", "fields" : { "city" : {"type" : "string", "index" : "analyzed"}, "raw_city" : {"type" : "string", "index" : "not_analyzed", "store": "no"} } }, "region" : { "type" : "multi_field", "fields" : { "region" : {"type" : "string", "index" : "analyzed"}, "raw_region" : {"type" : "string", "index" : "not_analyzed", "store": "no"} } }, "state" : { "type": "boolean" } } } }

and I've this model in mongo for dropdowns:

{ created: { type: Date, default: Date.now }, analytics: { type: String, default: '', trim: true }, state: { type: Boolean, default: false, index: true }, show: [{ type: Schema.ObjectId, ref: 'Show' }], venues:[{ venue:{ type: Schema.ObjectId, ref: 'Venue', index: true }, site: { type: String, trim: true, index: true } }] }

I'd map dropdowns with parent/child schema into my index, but I can't understand if is possibile with ObjectId because I've tried with this mapping:

"dropdowns": { "properties" : { "state": { "type": "boolean" }, "analytics": { "type": "string" }, "show": { "_parent":{ "type" : "shows" } }, "venues" : { "properties" : { "venue" : { "_parent": { "type" : "venues" } } }, "site" : {"type" : "string"} } } }

but I received this error "MapperParsingException[No type specified for property [show]]"

There is anyway to setting up correctly my index?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant