0
votes

I have multiple instances of my application. each application is pointing to its own solr for document indexing.

I am working on a unified search, where user hit a query in the search bar and the relevant documents from all the instance should be ranked based on relevance.

Right now I have implemented a solution based on Round Robin fashion.

For example, I have 2 instances, Ins-1 with solr-1 and Ins-2 with solr-2. Ins-1 has 1K docs and Ins-2 has 5K docs. when I hit any query, the query will fetch X number of docs from solr-1 and X number of docs from solr-2. I am showing those 2X documents in round robin fashion. But it is not a best way to show the search result. I am looking for a solution where I can re-rank those 2X documents based on relevance to the search.

2
Are the schema identical on both instances? Are they single cores, or are they cloud instances with collections?MatsLindh
yes, schema identical on both instances. They are single cores and they are cloud instances with collections.Sandeep Joshi
@MatsLindh: Any suggestion?Sandeep Joshi
The regular approach is to create a dummy core, with the same schema, then use manual sharding through the shards parameter to search both cores at the same time as a unified result set. But if you're using cloud mode, that might be hard to coordinate as the number of nodes grow.MatsLindh
@MatsLindh: Can we re-rank those 2X documents using Lucene API / Solr API or some other algorithm after fetching from different solr?Sandeep Joshi

2 Answers

0
votes

I think you should merge the two instances into single instance. You can import data from one instance to another. Solr Admin UI has a tab 'DataImport' to import data from one collection to another.

0
votes

here doc1 and doc2 are two invidual responses from solr you can do it in JAVA

  SolrDocumentList appendResponse(SolrDocumentList doc1,SolrDocumentList doc2) {
    SolrDocumentList documentsList=new SolrDocumentList();
    for (SolrDocument solrDocument:doc1) 
    { 
            documentsList.add(solrDocument);
    }
    for (SolrDocument solrDocument:doc2) 
    { 
            documentsList.add(solrDocument);
    }

    return documentsList;
}