Hello,
I'm using Solr with a postgreSQL database. I need to search across two
tables with no link between them.
ie : I have got a "messages" table and a "newsfeeds" table, nothing
liking them.
I tried to configure my data-config.xml to implement this but it seems
that tables can't be defined separately.
The configuration I first tried was the following :
<dataConfig>
<dataSource driver="org.postgresql.Driver"
url="jdbc:postgresql://host/database" user="user" password="password" />
<document>
<entity name="newsfeeds" query="select id as nf_id, text as nf_text,
url, note from newsfeeds" >
<field column="nf_text" />
</entity>
<entity name="messages" query="select id as m_id, body from messages" >
<field column="body" />
</entity>
</document>
</dataConfig>
Note that the two entities are at the same level. Only the first entity
("newsfeeds") will give results
I then tried this config :
<dataConfig>
<dataSource driver="org.postgresql.Driver"
url="jdbc:postgresql://host/database" user="user" password="password" />
<document>
<entity name="newsfeeds" query="select id as nf_id, text as nf_text,
url, note from newsfeeds" >
<field column="nf_text" />
<entity name="messages" query="select id as m_id, body from messages" >
<field column="body" />
</entity>
</entity>
</document>
</dataConfig>
As expected the results were crossed.
I wonder how I could implement the search over two independent tables?
Thanks for any answer.
Anthony