So, I have a lot of running solr instances, and to send a request, I just added a quick website. After I make the request URL, in php, I use the following to get the XML response from solr:
$solr_return= file_get_contents($full_request_URL);
Now the answer is not in simple XML format, and it has solr-ness if you know what I mean. I want to be able to parse the returned xml and show them in rows in a table in html.
I look online, and there are many different ideas that make me think, maybe I'm completely off, and thatβs not the way to do it. How would you do it if you were me?
The xml in $solr_return as follows:
<?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">95</int> <lst name="params"> <str name="indent">true</str> <str name="rows">10</str> <str name="start">0</str> <str name="q">*:*</str> <str name="shards">some shards here</str> </lst> </lst> <result name="response" numFound="2403043" start="0"> <doc> <str name="1">test1</str> <str name="2">test2</str> <str name="3">test3</str> </doc> <doc> <str name="1">test1</str> <str name="2">test2</str> <str name="3">test3</str> </doc> </result> </response>
In this example, I want to show a table with three columns of 1, 2 and 3 and two rows test1, test2 and test3.
Thank you for your help in advance.
source share