Either way (Endeca's 307, which seems crazy to me) or simply plucking off a "url" field from the first document returned in a search request... you're getting a URL back to your client and then using that URL to further send back to a users browser, I presume. I personally wouldn't implement it with a custom response writer, just get the URL from the standard Solr response.
Erik On Dec 7, 2011, at 08:26 , Finotti Simone wrote: > That's the scenario: > I have an XML that maps words W to URLs; when a search request is issued by > my web client, a query will be issued to my Solr application. If, after > stemming, the query matches any in W, the client must be redirected to the > associated URL. > > I agree that it should be handled outside, but we are currently on progress > of migrating from Endeca, and it has a feature that allow this scenario. For > this reason, my boss asked if it was somehow possible to leave that > functionality in the search engine. > > thanks again > > ________________________________________ > Inizio: Erik Hatcher [erik.hatc...@gmail.com] > Inviato: mercoledì 7 dicembre 2011 14.12 > Fine: solr-user@lucene.apache.org > Oggetto: Re: Solr response writer > > First, could you tell us more about your use case? Why do you want to > change the response code? HTTP 307 = Temporary redirect - where are you > going to redirect? Sounds like something best handled outside of Solr. > > If you went down the route of creating your own custom response writer, then > you'd be locked into a single format (XML, or JSON, or which ever that you > subclassed) > > > On Dec 7, 2011, at 06:48 , Finotti Simone wrote: > >> Hello, >> I need to change the HTTP result code of the query result if some conditions >> are met. >> >> Analyzing the flow of execution of Solr query process, it seems to me that >> the "place" that fits better is the QueryResponseWriter. Anyway I didn't >> found a way to change the HTTP request layout (I need to set 307 instead of >> 200), so I wonder if it's possible at all with the Solr (v 3.4) plugin >> mechanism actually provided. >> >> Any insight would be greatly appreciated J >> >> Thanks >> S > > > > >