On 12 November 2012 13:00, 122jxgcn <ywpar...@gmail.com> wrote: [...] > What I want to do right now is that whenever the client indexes document and > uploads the raw file, > database gets update with the pairs of (Document ID in Solr, path of the raw > file inside server). > So on search result page, instead of giving the direct link of the raw file, > I'd like to make server to look up the database based on the Document ID in > Solr and return the linked file path.
This might make sense if you were using Solr to search for the ID of an object in the database with relations to other objects. However, if all you are doing is retrieving the file path/URL, why not index that into Solr, and get it directly from Solr? If you still want to do what you had in mind, you should handle that as part of your indexing process, i.e., update both Solr and the database at the same time, or update the database and index to Solr from there. Regards, Gora