You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Patrick Kirsch <p-...@gmx.de> on 2011/01/08 15:17:04 UTC

Show SQL-DIH datasource name in result list

Hey,
  does somebody know, if there is a command option in Solr to show which 
datasource provided the result.
Or with other words: is it possible to output in the result the tag name 
given in <datasource /> or <entity />?

  Let me explain:
  - I'm using the SQL-DIH with a lot of datasources and several 
entities. Every datasource has a name e.g. <dataSource name="cat"> and 
every entity, too, e.g. <entity name="dog">

  - Now at the result list I would need to know, which e.g. table the 
result provided, e.g.

  <result name="response" numFound="8" start="0" origin="cat">
  <doc origin="dog">
   <int>0</int>
  </doc>


Thanks,
  Patrick





Re: Show SQL-DIH datasource name in result list

Posted by Gora Mohanty <go...@mimirtech.com>.
On Sat, Jan 8, 2011 at 7:47 PM, Patrick Kirsch <p-...@gmx.de> wrote:
> Hey,
>  does somebody know, if there is a command option in Solr to show which
> datasource provided the result.
> Or with other words: is it possible to output in the result the tag name
> given in <datasource /> or <entity />?
[...]

You would need to index the tag name in a separate field.

>  <result name="response" numFound="8" start="0" origin="cat">
>  <doc origin="dog">
>  <int>0</int>
>  </doc>
[...]

Also, if you want exactly the above format, you would need
to use XSLT to transform the data-source name from the
field in which it was indexed into the attribute "origin" for the
response.

Regards,
Gora