大网数据广告活动
PHP 语言与运行手册

The SolrInputDocument class

· 52CE 我爱测

This class represents a Solr document that is about to be submitted to the Solr index.

The SolrInputDocument class

(PECL solr >= 0.9.2)

Introduction

This class represents a Solr document that is about to be submitted to the Solr index.

Class synopsis

final class SolrInputDocument {
/* Constants */
const int SORT_DEFAULT = 1;
const int SORT_ASC = 1;
const int SORT_DESC = 2;
const int SORT_FIELD_NAME = 1;
/* Methods */
public function __construct()
public function addChildDocument(SolrInputDocument $child): void
public function addChildDocuments(array &$docs): void
public function addField(string $fieldName, string $fieldValue, float $fieldBoostValue = 0.0): bool
public function clear(): bool
public function __clone(): void
public function deleteField(string $fieldName): bool
public function fieldExists(string $fieldName): bool
public function getBoost(): float
public function getChildDocuments(): array
public function getChildDocumentsCount(): int
public function getField(string $fieldName): SolrDocumentField
public function getFieldBoost(string $fieldName): float
public function getFieldCount(): int|false
public function getFieldNames(): array
public function hasChildDocuments(): bool
public function merge(SolrInputDocument $sourceDoc, bool $overwrite = true): bool
public function reset(): bool
public function setBoost(float $documentBoostValue): bool
public function setFieldBoost(string $fieldName, float $fieldBoostValue): bool
public function sort(int $sortOrderBy, int $sortDirection = SolrInputDocument::SORT_ASC): bool
public function toArray(): array
public function __destruct()
}

Predefined Constants

SolrInputDocument Class Constants

SolrInputDocument::SORT_DEFAULT

Sorts the fields in ascending order.

SolrInputDocument::SORT_ASC

Sorts the fields in ascending order.

SolrInputDocument::SORT_DESC

Sorts the fields in descending order.

SolrInputDocument::SORT_FIELD_NAME

Sorts the fields by name

SolrInputDocument::SORT_FIELD_VALUE_COUNT

Sorts the fields by number of values.

SolrInputDocument::SORT_FIELD_BOOST_VALUE

Sorts the fields by boost value.

Table of Contents

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。