Search code examples
solr

Returning line numbers in Solr response


Is it possible, in the response of a Solr query, to also return the line numbers in a document at the points where the results occur? Would that be a role of one of the formatters? If so, how do you enable it?


Solution

  • The solution on which I have ended up using is to export line numbers (because it is source code I am indexing) to the indexing process; in other words, I prefix each exported line with the line number, which I apply as I read the source code for indexing.