首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

SolrDocument (class)

Introduction

(PECL solr >= 0.9.2)

Represents a Solr document retrieved from a query response.

Class synopsis

final SolrDocument implements ArrayAccess , Iterator , Serializable {

/* Constants */

const integer SORT_DEFAULT = 1 ;

const integer SORT_ASC = 1 ;

const integer SORT_DESC = 2 ;

const integer SORT_FIELD_NAME = 1 ;

const integer SORT_FIELD_VALUE_COUNT = 2 ;

const integer SORT_FIELD_BOOST_VALUE = 4 ;

/* Methods */

代码语言:javascript
复制
public bool addField ( string $fieldName , string $fieldValue )
代码语言:javascript
复制
public bool clear ( void )
代码语言:javascript
复制
public void __clone ( void )
代码语言:javascript
复制
public __construct ( void )
代码语言:javascript
复制
public SolrDocumentField current ( void )
代码语言:javascript
复制
public bool deleteField ( string $fieldName )
代码语言:javascript
复制
public void __destruct ( void )
代码语言:javascript
复制
public bool fieldExists ( string $fieldName )
代码语言:javascript
复制
public SolrDocumentField __get ( string $fieldName )
代码语言:javascript
复制
public array getChildDocuments ( void )
代码语言:javascript
复制
public integer getChildDocumentsCount ( void )
代码语言:javascript
复制
public SolrDocumentField getField ( string $fieldName )
代码语言:javascript
复制
public int getFieldCount ( void )
代码语言:javascript
复制
public array getFieldNames ( void )
代码语言:javascript
复制
public SolrInputDocument getInputDocument ( void )
代码语言:javascript
复制
public bool hasChildDocuments ( void )
代码语言:javascript
复制
public bool __isset ( string $fieldName )
代码语言:javascript
复制
public string key ( void )
代码语言:javascript
复制
public bool merge ( SolrDocument $sourceDoc [, bool $overwrite = true ] )
代码语言:javascript
复制
public void next ( void )
代码语言:javascript
复制
public bool offsetExists ( string $fieldName )
代码语言:javascript
复制
public SolrDocumentField offsetGet ( string $fieldName )
代码语言:javascript
复制
public void offsetSet ( string $fieldName , string $fieldValue )
代码语言:javascript
复制
public void offsetUnset ( string $fieldName )
代码语言:javascript
复制
public bool reset ( void )
代码语言:javascript
复制
public void rewind ( void )
代码语言:javascript
复制
public string serialize ( void )
代码语言:javascript
复制
public bool __set ( string $fieldName , string $fieldValue )
代码语言:javascript
复制
public bool sort ( int $sortOrderBy [, int $sortDirection = SolrDocument::SORT_ASC ] )
代码语言:javascript
复制
public array toArray ( void )
代码语言:javascript
复制
public void unserialize ( string $serialized )
代码语言:javascript
复制
public bool __unset ( string $fieldName )
代码语言:javascript
复制
public bool valid ( void )

}

Predefined Constants

SolrDocument::SORT_DEFAULT

Default mode for sorting fields within the document.

SolrDocument::SORT_ASC

Sorts the fields in ascending order

SolrDocument::SORT_DESC

Sorts the fields in descending order

SolrDocument::SORT_FIELD_NAME

Sorts the fields by field name.

SolrDocument::SORT_FIELD_VALUE_COUNT

Sorts the fields by number of values in each field.

SolrDocument::SORT_FIELD_BOOST_VALUE

Sorts the fields by thier boost values.

Table of Contents

  • SolrDocument::addField — Adds a field to the document
  • SolrDocument::clear — Drops all the fields in the document
  • SolrDocument::__clone — Creates a copy of a SolrDocument object
  • SolrDocument::__construct — Constructor
  • SolrDocument::current — Retrieves the current field
  • SolrDocument::deleteField — Removes a field from the document
  • SolrDocument::__destruct — Destructor
  • SolrDocument::fieldExists — Checks if a field exists in the document
  • SolrDocument::__get — Access the field as a property
  • SolrDocument::getChildDocuments — Returns an array of child documents (SolrDocument)
  • SolrDocument::getChildDocumentsCount — Returns the number of child documents
  • SolrDocument::getField — Retrieves a field by name
  • SolrDocument::getFieldCount — Returns the number of fields in this document
  • SolrDocument::getFieldNames — Returns an array of fields names in the document
  • SolrDocument::getInputDocument — Returns a SolrInputDocument equivalent of the object
  • SolrDocument::hasChildDocuments — Checks whether the document has any child documents
  • SolrDocument::__isset — Checks if a field exists
  • SolrDocument::key — Retrieves the current key
  • SolrDocument::merge — Merges source to the current SolrDocument
  • SolrDocument::offsetExists — Checks if a particular field exists
  • SolrDocument::offsetGet — Retrieves a field
  • SolrDocument::offsetSet — Adds a field to the document
  • SolrDocument::offsetUnset — Removes a field
  • SolrDocument::reset — This is an alias to SolrDocument::clear()
  • SolrDocument::rewind — Resets the internal pointer to the beginning
  • SolrDocument::serialize — Used for custom serialization
  • SolrDocument::__set — Adds another field to the document
  • SolrDocument::sort — Sorts the fields in the document
  • SolrDocument::toArray — Returns an array representation of the document
  • SolrDocument::unserialize — Custom serialization of SolrDocument objects
  • SolrDocument::__unset — Removes a field from the document
  • SolrDocument::valid — Checks if the current position internally is still valid

← SolrInputDocument::toArray

SolrDocument::addField →

代码语言:txt
复制
 © 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

扫码关注腾讯云开发者

领取腾讯云代金券