[ 
https://issues.apache.org/jira/browse/SOLR-4970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13694813#comment-13694813
 ] 

Jilani Shaik commented on SOLR-4970:
------------------------------------


But before we go any further, can you describe your solution? It sounds like 
you join on unique-keys between two different solr collections? 
- Yes, currently unique-keys ( Please suggest if any option available)
Solution: Please refer attached document.
base query will be get some products along with count of those products in 
transaction index.

the ultimate result will looks like as mentioned below

say index1
product name1, product desc, ....
product name2, product desc, ....
product name3, product desc, ....

say index2
product name1, customer name1, date of purchase,....,purchased quantity, amount
product name1, customer name1, date of purchase,....,purchased quantity, amount
product name2, customer name1, date of purchase,....,purchased quantity, amount

result with the custom request handler is as follows
product name1, product desc, ...., 2( count - how many products purchased)
product name2, product desc, ...., 1( count - how many products purchased)




How well does it perform? 
- We tested the same for 2000+ from one collection and almost 1 million docs 
from other collection. Performance wise no issue. 

Why do you need to extend SolrDispatchFilter and why does it need a custom JSON 
response writer?
- Currently this solution intercepts the request from client if the request 
handler name is defined in solrconfig.xml as mentioned in attached document. 
Then it will follow the same as dispatchfilter life cycle but before going to 
write the response to client it will go and execute the query defined in 
solrconfig.xml or using the params provided by the client and will make a 
request to solr to execute the second query and will fetch the result as 
namedList object and concatenate the response to first query response.
In custom response writer managed to get the data which is added and will 
append as a document content of first query result.



It sounds like your solution works on top of Solr instead of integrating with 
solr internals. If it is the former than it would be difficult to ship it with 
Solr.

                
> Collection communication for merging the facet query result from one 
> collection to other collection
> ---------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-4970
>                 URL: https://issues.apache.org/jira/browse/SOLR-4970
>             Project: Solr
>          Issue Type: New Feature
>          Components: SearchComponents - other
>            Reporter: Jilani Shaik
>            Priority: Minor
>              Labels: features
>         Attachments: collectioncomm.zip, Solr Collection communication.docx
>
>
> Scenario: 
> We will have two categories of data, where one category will be the list of 
> primary data (for example products) and the other collection (it could be 
> spread across shards) holds the transaction data (for example product sales 
> data). We have a search scenario where we need to show the products along 
> with the number of sales for each product. 
> We can do flatten the schema with all data together, But if the primary 
> data(it could be very less may be <10000) should be in one collection where 
> as the transaction data(it could be in millions) in multiple shards, then we 
> wish to have this feature where the request handler will search the data from 
> one collection and the corresponding search results docs should pass to the 
> next query for faceting and then before writing the response merge these 
> together to appear the result as coming from one collection. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to