-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle user-specific requests that are not already handled #49
base: master
Are you sure you want to change the base?
Handle user-specific requests that are not already handled #49
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look like suggester didn't have response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: