Set Nested document type

4 views
Skip to first unread message

aash dhariya

unread,
Dec 29, 2012, 7:48:48 AM12/29/12
to elasti...@googlegroups.com
In a elastictastic model, "embed" is used to set the properties of embedded document. But along with this is there any way to set the type of the embedded document as nested. For example
When I have A.rb as
class User
  include Elastictastic::Document

  embed :tags, class_name: "Tag"
end

With this I am getting the mapping of A as:
{"a"=>
  {"properties"=>
     "tags"=>
      {"properties"=>
        {"tag_type"=>{"type"=>"string"}, "tag_value"=>{"type"=>"string"}}}}}}

What should I do when I want to set the mapping as below:
{"a"=>
  {"properties"=>
    {"user_id"=>{"type"=>"string"},
     "college_id"=>{"type"=>"string"},
     "verified_user"=>{"type"=>"boolean"},
     "user_type"=>{"type"=>"string"},
     "tags"=>{
         "type":"nested"
         "properties"=>
        {"tag_type"=>{"type"=>"string"}, "tag_value"=>{"type"=>"string"}}}}}}

-- 
Thanks, 
Aash

Matthew A. Brown

unread,
Dec 29, 2012, 9:29:02 AM12/29/12
to elasti...@googlegroups.com
Hi Aash,

Elastictastic doesn't support nested documents right now, but it would be easy enough to do so. Feel free to submit a GH issue or, even better, a pull request.

Mat


--
 
 

aash dhariya

unread,
Dec 30, 2012, 12:39:08 AM12/30/12
to elasti...@googlegroups.com
ok. will do that...thanks for your quick reply


--
 
 



--
Thanks, 
Aash
Reply all
Reply to author
Forward
0 new messages