note 107941 added to solr.examples
| From: | khe77oatgmaildotyouknowwhat | Date: | Thu, 15 Mar 2012 17:53:47 +0000 |
| Subject: | note 107941 added to solr.examples | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186692@lists.php.net to get a copy of this message | ||
The documentation in the example section doesn't mention that you need to commit once
you've added doc(s).
So in short it would be something like:
$client = new SolrClient(array('hostname' => '127.0.0.1', 'port'
=> 8080));
$doc = new SolrInputDocument();
$doc->addField('id', 12345);
$doc->addField('name', 'some person');
$result = $client->addDocument($doc);
/* you are not done yet, you need to commit */
$client->commit();
Now if you query you should see your doc =]
----
Server IP: 69.147.83.197
Probable Submitter: 159.153.140.10
----
Manual Page -- http://www.php.net/manual/en/solr.examples.php
Edit -- https://master.php.net/note/edit/107941
Del: integrated -- https://master.php.net/note/delete/107941/integrated
Del: useless -- https://master.php.net/note/delete/107941/useless
Del: bad code -- https://master.php.net/note/delete/107941/bad+code
Del: spam -- https://master.php.net/note/delete/107941/spam
Del: non-english -- https://master.php.net/note/delete/107941/non-english
Del: in docs -- https://master.php.net/note/delete/107941/in+docs
Del: other reasons-- https://master.php.net/note/delete/107941
Reject -- https://master.php.net/note/reject/107941
Search -- https://master.php.net/manage/user-notes.php