Firslty, I know some similar questions according to this, but I think that this situation is different enough to justify my own question.
I am running the Solr index using a berth installation on the LAMP server. I am currently using a function simplexml_load_fileto enter search results and then parse them through a couple of functions. I was pleased with this process until I began to run into a fundamental problem.
Field names are not 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>
It will look like this in a 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 complete data set is found, 11 bits of data are stored in the array, but when some of them are missing, the data moves and my parser breaks up.
, /, . , ; Apache Solr solr-php-client, , , , , .
? , .
!