You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2018. It is now read-only.
The original problem was to figure out how to search for authors having specific tags and who have written certain kind of books having specific tags.
I asked this question in IRC and @xeago suggested that nested mapping is the way to go. I looked up the nested mapping example in the tire repo.
Unfortunately my data isn't as simple as the models given in the example (posts, comments) - or maybe it actually is - I don't know because somewhere I am messing up the tire dsl
I tried something like this,
#inside author.rbmappingdoindexes:name,:type=>'string',indexes:tags,:properties=>{:name{:type=>'string'}},indexes:books,:properties=>{:type=>'nested',:book_type=>{:type=>'string'},:tags=>{:name=>{:type=>'string'}}end# this is to build the datastructure for authordefto_indexed_json{:books=>books.map(&to_document),:tags=>tags.map{ |t| {:name=>t.name}},:name=>name}.to_jsonend#inside book.rbdefto_document{:book_type=>book_type,:tags=>tags.map{ |t| {:name=>t.name}}}end
What's happening is that the 'nested' property of books as defined in the mapping isn't being respected once Author.import is called and the data is indexed.
I have been stuck at this for 3 days :|
Thank you,
Rahul
The text was updated successfully, but these errors were encountered:
@phoet I came across that issue before and should have paid more attention to it then. I sat down with it today and got it to work. Thank you for your suggestion.
Hi guys,
I posted an issue in stackoverflow but it wasn't of any help.
Please take a look at http://stackoverflow.com/questions/17591034/complex-tire-query-involving-nested-models.
The original problem was to figure out how to search for authors having specific tags and who have written certain kind of books having specific tags.
I asked this question in IRC and @xeago suggested that nested mapping is the way to go. I looked up the nested mapping example in the tire repo.
Unfortunately my data isn't as simple as the models given in the example (posts, comments) - or maybe it actually is - I don't know because somewhere I am messing up the tire dsl
I tried something like this,
What's happening is that the 'nested' property of books as defined in the mapping isn't being respected once Author.import is called and the data is indexed.
I have been stuck at this for 3 days :|
Thank you,
Rahul
The text was updated successfully, but these errors were encountered: