You could change starttime and channelname to multiValued=true and use
these fields to store all the values for those fields.
showing.movie_id and showing.id probably isn't needed in a solr record.
On 8/24/11 7:53 AM, Zac Tolley wrote:
I have a very scenario in which I have a film and showings, each film has
multiple showings at set times on set channels, so I have:
Movie
-----
id
title
description
duration
Showing
-----
id
movie_id
starttime
channelname
I want to know can I store this in solr so that I keep this stucture?
I did try to do an initial import with the DIH using this config:
<entity name="movie" query="SELECT * from movies">
<field column="ID" name="id"/>
<field column="TITLE" name="title"/>
<field name="DESCRIPTION" name="description"/>
<entity name="showing" query="SELECT * from showings WHERE movie_id = ${
movie.id}">
<field column="ID" name="id"/>
<field column="STARTTIME" name="starttime"/>
<field column="CHANNELNAME" name="channelname"/>
</entity>
</entity>
I was hoping, for each movie to get a sub entity with the showing like:
<doc>
<str name="title">.....</str>
<showing>
<str name="channelname".....
but instead all the fields are flattened down to the top level.
I know this must be easy, what am I missing... ?