THanks - That's a good question.
I thought of using one single SQL statement - but the nested entity's
query is actually quite complex (unlike the example).
So it'd be possible, but more readable as a separate query.
Further, MySQL has some limitations also about temporary tables and
seems like separate queries (in terms of performance).
On Oct 28, 2009, at 2:49 PM, Fuad Efendi wrote:
Why can't we use single entity with single SELECT ... LEFT OUTER
JOIN ...?
-----Original Message-----
From: Jonathan Hendler [mailto:jonathan.hend...@gmail.com]
Sent: October-28-09 1:33 PM
To: solr-user@lucene.apache.org
Subject: Simple problem with a nested entity and it's SQL
I have a nested entity on a jdbc data import handler that is causing
an SQL error because the second key is either NULL (blank when
generating the sql) or non-zero INT.
The query is in the following form:
<document name="content">
<entity name="bl_lessonfiles"
transformer="TemplateTransformer" query="SELECT * FROM table1 ">
...
<entity name="user_index" query="SELECT * FROM
table2
WHERE id = $
{table1.somethin_like_a_foreign_key} ">
....
</entity>
</entity>
</document>
Is the only way to avoid this to modify the source DB schema to be
NOT
NULL so it always returns at least a 0?
- Jonathan