File: 059.solrinputdocument_getfield.phpt

package info (click to toggle)
php-solr 2.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,620 kB
  • sloc: ansic: 14,274; xml: 1,313; php: 1,239; pascal: 11; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 438 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
SolrInputDocument::getField
--FILE--
<?php

require_once "bootstrap.inc";
$doc = new SolrInputDocument();

$doc->addField('id', 123);
$doc->addField('cat', 'Software');

var_dump($doc->getField('id'));
var_dump($doc->getField('non_existing_field'));
?>
--EXPECT--
object(SolrDocumentField)#2 (3) {
  ["name"]=>
  string(2) "id"
  ["boost"]=>
  float(0)
  ["values"]=>
  array(1) {
    [0]=>
    string(3) "123"
  }
}
bool(false)