note 107308 added to class.solrquery
| From: | andy at borkedcoder dot com | Date: | Sun, 29 Jan 2012 23:36:40 +0000 |
| Subject: | note 107308 added to class.solrquery | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185787@lists.php.net to get a copy of this message | ||
Note - if using morelikethis, and your query is on a numeric ID, then you will not be able to access
the moreLikeThis object in the results...
when q=id:3493 searching with mlt, result is:
SolrObject Object
(
...
[moreLikeThis] => SolrObject Object
(
[3493] => SolrObject Object
(
[numFound] => 6286
[start] => 0
[docs] => Array
(
....etc
the numeric object name (3493 above) is impossible to access
not by $response->moreLikeThis->{3493} nor $response->moreLikeThis->{'3493'},
nothing...
only way is to convert the moreLikeThis object into an array with:
$response_array = (array) $response->moreLikeThis;
then iterate the array as the array key is known.
----
Server IP: 69.147.83.197
Probable Submitter: 188.165.240.100
----
Manual Page -- http://www.php.net/manual/en/class.solrquery.php
Edit -- https://master.php.net/note/edit/107308
Del: integrated -- https://master.php.net/note/delete/107308/integrated
Del: useless -- https://master.php.net/note/delete/107308/useless
Del: bad code -- https://master.php.net/note/delete/107308/bad+code
Del: spam -- https://master.php.net/note/delete/107308/spam
Del: non-english -- https://master.php.net/note/delete/107308/non-english
Del: in docs -- https://master.php.net/note/delete/107308/in+docs
Del: other reasons-- https://master.php.net/note/delete/107308
Reject -- https://master.php.net/note/reject/107308
Search -- https://master.php.net/manage/user-notes.php