I use Solr to index my report database. Reports may contain text, information about submitters, etc. This currently works and looks like this:
"docs": [ { "Text": "Some Report Text" "ReportId": "1", "Date": "2013-08-09T14:59:28.147Z", "SubmitterId": "11111", "FirstName": "John", "LastName": "Doe", "_version_": 1444554112206110700 } ]
Otherwise, what a report can have is viewers (this is a one-to-many relationship between one report and viewers.) I want to be able to capture these viewers like this in my JSON release:
"docs": [ { "Text": "Some Report Text" "ReportId": "1", "Date": "2013-08-09T14:59:28.147Z", "SubmitterId": "11111", "FirstName": "John", "LastName": "Doe", "Viewers": [ { ViewerId: "22222" }, { ViewerId: "33333" } ] "_version_": 1444554112206110700 } ]
I can not seem that this will happen. Here is my data-config.xml (removed parts that are not needed for the question):
<entity name="Report" query="select * from Reports"> <field column="Text" /> <field column="ReportId" /> <entity name="Viewers" query="select * from ReportViewers where Id='${Report.ReportId}'"> <field column="Id" name="ViewerId" /> </entity> </entity>
And schema.xml :
<field name="Text" type="text_en" indexed="true" stored="true" /> <field name="ReportId" type="string" indexed="true" stored="true" /> <field name="Viewers" type="string" indexed="true" stored="true" multiValued="true" /> <field name="ViewerId" type="string" indexed="true" stored="true" />
When I import data, I donβt see anything. There are no errors, nothing is clearly wrong, but I'm sure my config-data and / or my schema is wrong. What am I doing wrong?