title: Solr around search: Get position of a specific result, and the results around it
body: <p>I'm not sure, if Solr can handle such a thing, or if there are other workarounds:</p>
  
  <p>I have a search in solr, with several parameters, in a Rails app. The results are displayed, paginated, on a website. When a user clicks on a result, I want to present them other results before and after the clicked result on the detail page, so that she or he can click through the list on the detail page of a result.</p>
  
  <p>How can I do such a thing? For now, I'm caching the search parameters in a session, repeat the search, get all hits back, and search in the array for the position of my current element. The drawback is obvious: This becomes slower and slower, the more results the whole search returns (in my case about 2.8s for a search with 5000 results).</p>
  
  <p>So, is there some "around-search" feature in Solr, that I don't know? Like, I have the search parameters, and the ID of a product, and want to display the results around a specific result?</p>
  
  <p>I know that I could cache all the results BEFORE the detail page, but that would mess up with pagination.</p>
  
  <p>I hope I made myself clear, otherwise, please comment ;)</p>