: dissimilarity functions). What I want to do is to search using common : text search and then (optionally) re-rank using some custom function : like : : http://localhost:8983/solr/select?q=*:*&sort=myCustomFunction(var1) asc
can you describe what you want your custom function to look like? it may already be possible using the existing functions provided out of hte box - just neeed to combine them to build up the mathc expression... https://wiki.apache.org/solr/FunctionQuery ...if you really want to write your own, just implement ValueSourceParser and register it in solrconfig.xml... https://wiki.apache.org/solr/SolrPlugins#ValueSourceParser : I've seen that there are hooks in solrconfig.xml, but I did not find : an example or some documentation. I'd be most grateful if anyone could : either point me to one or give me a hint for another way to go :) when writing a custom plugin like this, the best thing to do is look at the existing examples of that plugin. almost all of hte built in ValueSourceParsers are really trivial, and can be found in tiny anonymous classes right inside the ValueSourceParser.java... For example, the function ot divide the results of two other fnctions... addParser("div", new ValueSourceParser() { @Override public ValueSource parse(FunctionQParser fp) throws SyntaxError { ValueSource a = fp.parseValueSource(); ValueSource b = fp.parseValueSource(); return new DivFloatFunction(a, b); } }); ..or, if you were trying to bundle that up in your own plugin jar and register it in solrconfig.xml, you might write it something like... public class DivideValueSourceParser extends ValueSourceParser { public DivideValueSourceParser() { } public ValueSource parse(FunctionQParser fp) throws SyntaxError { ValueSource a = fp.parseValueSource(); ValueSource b = fp.parseValueSource(); return new DivFloatFunction(a, b); } } and then register it as... <valueSourceParser name="div" class="com.you.DivideValueSourceParser" /> depending on your needs, you may also want to write a custom ValueSource implementation (ie: instead of DivFloatFunction above) in which case, again, the best examples to look at are all of the existing ValueSource functions... https://lucene.apache.org/core/4_4_0/queries/org/apache/lucene/queries/function/ValueSource.html -Hoss