[prev in list] [next in list] [prev in thread] [next in thread]
List: solr-user
Subject: Sub entities
From: Brian Lamb <brian.lamb () journalexperts ! com>
Date: 2011-02-28 20:52:28
Message-ID: AANLkTikZ65Hit1A3YQFMV4g3T+AWYqvnsvYV_Yynim0Z () mail ! gmail ! com
[Download RAW message or body]
Hi all,
I was able to get my dataimport to work correctly but I'm a little unclear
as to how the entity within an entity works in regards to search results.
When I do a search for all results, it seems only the outermost responses
are returned. For example, I have the following in my db config file:
<dataConfig>
<dataSource type="JdbcDataSource" name="mystuff" batchSize="-1"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/db?characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull"
user="user" password="password"/>
<document>
<entity name="animal" dataSource="mystuff" query="SELECT * FROM
animals">
<field column="id" name="id" />
<field column="type" name="type" />
<field column="genus" name="genus" />
<!-- Add in the species -->
<entity name="specie_relations" dataSource="mystuff" query="SELECT
specie_id FROMspecie_relations WHERE animal_id=${animal.id}">
<entity name="species" dataSource="mystuff" query="SELECT specie
FROM species WHERE id=${specie_relations.specie_id}">
<field column="specie" name="specie" />
</entity>
</entity>
</entity>
</document>
</dataSource>
</dataConfig>
However, specie never shows up in my search results:
<doc>
<str name="type">Mammal</str>
<str name="id">1</str>
<str name="genus">Canis</str>
</doc>
I had hoped the results would include the species. Can it? If so, what is my
malfunction?
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic