I have a Chemical search application where we will execute a Molecular search using a standard molecule matching engine and retrieve the IDs of the chemical structures and the hit's score or Similarity value from the engine.
My application will then invoke a SOLR with the list of IDs retrieved from the engine. I want to add the hit's score to the results.
1. Can I simply add this calculated field to SOLR's results? How?
2. Could I implement a SIMILARITY function to supply it as the score instead of the score created by Lucene?
3. I want to order the results by the score. The molecule search can drive this can I tell SOLR to retain the order of the ids passed as the search query?
We are using SOLR 3.5. It is part of a stack provided by our vendor and cannot just upgrade it.
I'm thinking implementing a custom Search handler to do molecule pre-search and then search solr with the output.
I am very new to SOLR and any help would be appreciated.
2
votes
1 Answers
0
votes
If you send IDs into Solr and then sorting by those same IDs, what do you actually need a Solr for? Or are you sub-selecting from those IDs afterwards using Solr query?
In any case, if your implementation allows you to change solrconfig.xml, you should be able to sneak a custom Request Handler in, which should allow you to build your pre- and post- processing. Here is one somewhat relevant article.
Regarding custom similarity, I am not sure you mean what you think you mean (custom Request Handler is a higher level intercept). However, if you do mean it, Wiki discusses what is possible before and after Solr 4.