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 Chris Hostetter <ho...@fucit.org> on 2011/11/01 23:40:33 UTC

Re: How to use an External Database for Fields?

: I don't think I'm quite getting this. Instead of going down that low,
: could you make your own ResponseWriter? That has access to all
: the information in the doc, and it seems like you could reach out to
: the DB at that point and get your information merrily adding it to the
: docs.

Agreed.  In 3.x and below this type of logic is expected to live in the 
QueryResponseWriters.  The new "Transformer" API in 4.x makes this easier 
to deal with ... so you can add/modify fields to SolrDocuments regardless 
of what response writer is in use.

https://wiki.apache.org/solr/DocTransformers
https://builds.apache.org/view/G-L/view/Lucene/job/Solr-trunk/javadoc/org/apache/solr/response/transform/DocTransformer.html
https://issues.apache.org/jira/browse/SOLR-1566

-Hoss

Re: How to use an External Database for Fields?

Posted by Erick Erickson <er...@gmail.com>.
Yep, you're on the right track here. Look at classes that implement
QueryResponseWriter,
perhaps CSVResponseWriter our XMLResponseWriter might be good places to start.

They get a SolrQueryResponse that contains the returned list...

Best
Erick

On Mon, Nov 7, 2011 at 2:29 PM, Draconissa <ar...@ldschurch.org> wrote:
>
> Chris Hostetter-3 wrote:
>>
>> Agreed.  In 3.x and below this type of logic is expected to live in the
>> QueryResponseWriters.
>>
>
> Forgive my ignorance, but where do QueryResponseWriters live? And where do
> they fit into the flow?
>
> I know how the different components fit into a distributed search, and how
> all the stages flow, but I haven't seen anything about response writers...
>
> Would it be something like using the distributed search and components to
> retrieve the doc_ids and facets, and once the entire distributed search is
> complete, a ResponseWriter would take the results (which is just doc ids
> since we didn't use the get_fields or any Database component), queries our
> SQL database, and creates the final response that gets sent to the client?
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-to-use-an-External-Database-for-Fields-tp3468308p3487972.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: How to use an External Database for Fields?

Posted by Draconissa <ar...@ldschurch.org>.
Chris Hostetter-3 wrote:
> 
> Agreed.  In 3.x and below this type of logic is expected to live in the 
> QueryResponseWriters.  
> 

Forgive my ignorance, but where do QueryResponseWriters live? And where do
they fit into the flow? 

I know how the different components fit into a distributed search, and how
all the stages flow, but I haven't seen anything about response writers...

Would it be something like using the distributed search and components to
retrieve the doc_ids and facets, and once the entire distributed search is
complete, a ResponseWriter would take the results (which is just doc ids
since we didn't use the get_fields or any Database component), queries our
SQL database, and creates the final response that gets sent to the client? 


--
View this message in context: http://lucene.472066.n3.nabble.com/How-to-use-an-External-Database-for-Fields-tp3468308p3487972.html
Sent from the Solr - User mailing list archive at Nabble.com.