Handle user-specific requests that are not already handled#49
Handle user-specific requests that are not already handled#49gadelkareem wants to merge 4 commits into
Conversation
|
Do you have any use case for this or you just think that people may need it? |
|
@vanng822 yes as I mentioned in the example above the |
|
|
||
| for k, r := range resp.Response { | ||
| switch k { | ||
| case "response": |
There was a problem hiding this comment.
Do we think that we still have some kind of response that is corresponding to collection. My thought is that we should skip this and put everything i Payload. We do very generic stuff here and let application go for specific parsing
There was a problem hiding this comment.
Look like suggester didn't have response?
There was a problem hiding this comment.
Do we think that we still have some kind of response that is corresponding to collection. My thought is that we should skip this and put everything i Payload. We do very generic stuff here and let application go for specific parsing
Since it is still part of Solr responds then it be parsed using the same methods in the library. Only if it is new response then it is left up to the developer to parse it.
Look like suggester didn't have response?
No the suggest response would look something like this:
{
"responseHeader":{
"status":0,
"QTime":2
},
"suggest":{
"suggester":{
"keyword":{
"numFound":0,
"suggestions":[
]
}
}
}
}
There was a problem hiding this comment.
And you're sure that response always contains documents response, ie
"response":{"numFound":1,"start":0,"maxScore":2.3025851,"docs":[ {...}]
There was a problem hiding this comment.
Mostly yes unless Solr change their response scheme
Every time a developer adds a new request handler with a new endpoint will need to create its own parser which is a bit of work. Therefore, I suggest to add such handler to allow developers to painlessly handle non standard requests. While errors and status is already handled by the library.
ex: