Firslty, I'm aware of some similar questions along the lines of this one, but I think this situation is different enough to warrant its own question.
I'm running a Solr index, through a jetty install on a LAMP server. I currently use the simplexml_load_file
function to bring in the search results and then parse them trough a couple of functions. I was happy with this process until I started running into a fundamental problem.
The field names don't get passed through the simplexml function. For example, this result;
<doc>
<float name="score">0.73325396</float>
<str name="add1">Ravensbridge Drive</str>
<str name="comments">0</str>
<str name="company">Stratstone Lotus Leicester</str>
<str name="feed_id"/>
<str name="id">1711765</str>
<str name="pcode">LE4 0BX</str>
<str name="psearch">LE4</str>
<str name="rating">0</str>
</doc>
Will look like this in the simplexml object;
[doc] => Array
(
[0] => SimpleXMLElement Object
(
[float] => 0.73325396
[str] => Array
(
[0] => Ravensbridge Drive
[1] => 0
[2] => Stratstone Lotus Leicester
[3] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => feed_id
)
)
[4] => 1711765
[5] => LE4 0BX
[6] => LE4
[7] => 0
)
)
When a full dataset is found, there is 11 bits of data stored in the array, but when some are missing, data moves around and my parser comes unstuck.
So, I've looked at libraries/classes to do it properly. Namely, the two main ones; Apache Solr and solr-php-client but both seem over complicated, with little amount of actual real world examples, and neither look like they support different solr cores, of which I use several.
Whats the best thing to use? I've got pretty stuck here now, any help would be MASSIVELY appreciated.
Thanks!