-
Notifications
You must be signed in to change notification settings - Fork 659
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
reproducer.. wt=phps incompatibility with /admin/luke still in doubts. .. #2114
base: main
Are you sure you want to change the base?
Conversation
mkhludnev
commented
Dec 4, 2023
Looks like there's a small mistake in the expected value. If
You can run some PHP code online to check the output: https://onlinephp.io?s=tY5NCsIwEEb3hd4hzCYVXPRHESaCuCi4EOwNSkxHGmib0DYiine3gYAX0NkM8wa-7-0PtrVxFEekWsN4-bCkZmqQr1l1qurychZxdJdj3bjeJm6YaNSy009KuMQMXxMWCL20IMKZpQidUzQQa4zyuPA4R9ANiOWPkPu9QVBmmgPaBjTInkKUxnRhO4SbMewqRxDvZfhqJb66RzU72f1O1nf-RfgD&v=8.2.10 |
@@ -84,9 +87,37 @@ public void writeResponse() throws IOException { | |||
|
|||
@Override | |||
public void writeNamedList(String name, NamedList<?> val) throws IOException { | |||
/*SimpleOrderedMap<Object> copy = new SimpleOrderedMap<>(); |
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.
remove me. wrong way
A side: I recall some doubt as to whether Solr ought to even have a "php" writer in the first place. Maybe it should be deprecated. Surely JSON is the standard? WDYT |
As someone on the PHP side of things, there's a good reason to look into PHPS with the curl 'http://localhost:8983/solr/techproducts/admin/luke?id=VDBDB1A16&json.nl=flat' Snippet of the output: "cat":{
"type":"string",
"schema":"I-S-UM----OF-----l",
"flags":"ITS-------OF------",
"value":"electronics",
"internal":"electronics",
"docFreq":15},
"cat":{
"type":"string",
"schema":"I-S-UM----OF-----l",
"flags":"ITS-------OF------",
"value":"memory",
"internal":"memory",
"docFreq":3}, The output for a This is a (admittedly very rare) case where dealing with JSON output in PHP is cumbersome. |
I think it's a valid question.. That applies to all the language specific writer types... Especially if we start supporting code generated API libraries that some of these wrappers for Solr could think about adopting? @thomascorthals, maybe a conversation for mailing list, but I'd love you thoughts on if we generated a PHP library, would that make your life easier? |
So... I think we are faced here with a different issue than how PHP is handling the output.... When I run the curl command that was shared, I also see the
and we drop the extra |
Okay, so I see that
Shouldn't this instead be instead an array of values for the
|
I hardly get common hesitation over duplicated JSON keys. Why it is a problem? Github come up with 480 json PHP parsers. Isn't there a library, which don't feel so unique about keys? |
Remember |
I guess my point is that the actual API response, in JSON, is outputting invalid JSON. That the fix is to change the way we handle multivalued fields to nest them as an array under the top level key.... |
It's invalid but the user is in control of supplying a different value to But this work item is about php. |
I had the same thought when I saw the generated Python client. Solarium aims at accurately modelling Solr by providing a fluent interface to build queries and parsing the results to PHP objects. The implementation for API requests is currently generic and just gets you the output from Solr as an array.
There is, and I'm already using it to parse that particular piece of JSON. There are two things at play for me:
That is for
Technically, it isn't. ECMA-404 doesn't say anything about it. RFC 8259 says names SHOULD be unique, not MUST. But you can see how this becomes a nuisance when decoding to a language that has no internal data structure that allows duplicate keys. |
Sorry; I wasn't paying enough attention. We shouldn't be using a |