...e->addField('partial'); $scheme->addField('total', array('type' => 'numeric', 'index' => 'self')); $scheme->addField('lastnum', array('type' => 'numeric', 'index' => 'self')); $scheme->addField('currnum', array('type' => 'numeric', 'index' => 'self')); $scheme->addField('...
... // 日期类型: 转换成专用的 YYYYmmdd 格式 if (!is_numeric($value) || strlen($value) !== 8) { $value = date('Ymd', is_numeric($value) ? $value : strtotime($value)); } } return $value;} 把给定的值转换为符合这个字段的数据格式
isNumeric() 方法 public bool isNumeric() {return} bool 是返回 true, 不是返回 false 源码: sdk/php/lib/XSFieldScheme.class.php#L357 (显示) public function isNumeric(){ return ($this->type == self::TYPE_NUMERIC);} 判断当前字段是否为数字型
...unction getConnString(){ $str = $this->_conn; if (is_int($str) || is_numeric($str)) { $str = 'localhost:' . $str; } elseif (strpos($str, ':') === false) { $str = 'unix://' . $str; } return $str;}
...ype $str = "[" . $this->name . "]\n"; if ($this->type === self::TYPE_NUMERIC) { $str .= "type = numeric\n"; } elseif ($this->type === self::TYPE_DATE) { $str .= "type = date\n"; } elseif ($this->type === self::TYPE_ID) { $str .= "type = id\n"; } elseif ($this->typ...
... // connect to server $conn = $this->_conn; if (is_int($conn) || is_numeric($conn)) { $host = 'localhost'; $port = intval($conn); } elseif (!strncmp($conn, 'file://', 7)) { // write-only for saving index exchangable data to file // NOTE: this will cause file con...
...e->addField('partial'); $scheme->addField('total', array('type' => 'numeric', 'index' => 'self')); $scheme->addField('lastnum', array('type' => 'numeric', 'index' => 'self')); $scheme->addField('currnum', array('type' => 'numeric', 'index' => 'self')); $scheme->addField('...
...ndex() 判断当前字段的索引是否为布尔型 XSFieldMeta isNumeric() 判断当前字段是否为数字型 XSFieldMeta isSpeical() 判断当前字段是否为特殊类型 XSFieldMeta toConfig() 将对象转换为配置文件字符串 XSFieldMeta val() 把给...
... if (($value = $doc->f($field)) !== null) { $varg = $field->isNumeric() ? XS_CMD_VALUE_FLAG_NUMERIC : 0; $value = $field->val($value); if (!$field->hasCustomTokenizer()) { // internal tokenizer $wdf = $field->weight | ($field->withPos(...
... // connect to server $conn = $this->_conn; if (is_int($conn) || is_numeric($conn)) { $host = 'localhost'; $port = intval($conn); } elseif (!strncmp($conn, 'file://', 7)) { // write-only for saving index exchangable data to file // NOTE: this will cause file con...