# ObjectIndexer

> A specialized SearchIndexer which provides methods to index a Unity Object from custom indexers.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor.Search](/engine/6000.7/script-reference/unityeditor/search.md)
* **Assembly:** UnityEditor
* **Inherits from:** [SearchIndexer](/engine/6000.7/script-reference/unityeditor/search/searchindexer.md)
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public abstract class ObjectIndexer : SearchIndexer, IDisposable
```

## Remarks

The [ObjectIndexer](/engine/6000.7/script-reference/unityeditor/search/objectindexer.md) can only be used in the context of a [CustomObjectIndexerAttribute](/engine/6000.7/script-reference/unityeditor/search/customobjectindexerattribute.md) and therefore cannot be instanciated explicitly.

```csharp
[CustomObjectIndexer(typeof(Collider), version = 3)]
static void IndexObjectSize(CustomObjectIndexerTarget target, ObjectIndexer indexer)
{
 var collider = target.target as Collider;
 if (collider == null)
 return;

 var totalSize = CustomSelectors.ComputeColliderSize(collider);
 indexer.IndexNumber(target.documentIndex, "collidersize", totalSize);
}
```

Note that you can use all of the [SearchIndexer](/engine/6000.7/script-reference/unityeditor/search/searchindexer.md) `Add*` indexing methods to add words, properties and numbers to the search index database. You can also use the following higher level functions (i.e. [IndexWord](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexword.md), [IndexNumber](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexnumber.md), [IndexProperty](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexproperty.md), [IndexWordComponents](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexwordcomponents.md) and [IndexPropertyComponents](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexpropertycomponents.md)) to index common [Unity Object](/engine/6000.7/script-reference/unityengine/object.md) properties.

## Methods

| Method                                                                                                                 | Description                                                                                |
| ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [IndexNumber](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexnumber.md)                         | Adds a key-number value pair to the index. The key won't be added with variations.         |
| [IndexProperty](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexproperty.md)                     | Adds a property value to the index. A property is specified with a key and a string value. |
| [IndexPropertyComponents](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexpropertycomponents.md) | Indexes multiple variations of a property value.                                           |
| [IndexWord](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexword.md)                             | Adds a new word coming from a specific document to the index.                              |
| [IndexWordComponents](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexwordcomponents.md)         | Splits a word into multiple variations.                                                    |

## Inheritance

**Inherited Members:**

* [SearchIndexer.Dispose()](/engine/6000.7/script-reference/unityeditor/search/searchindexer/dispose.md)
* [SearchIndexer.AddWord(string, int, int)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/addword.md#addword\(string-int-int\))
* [SearchIndexer.AddNumber(string, double, int, int)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/addnumber.md)
* [SearchIndexer.AddProperty(string, string, int)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/addproperty.md#addproperty\(string-string-int\))
* [SearchIndexer.AddProperty(string, string, int, int)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/addproperty.md#addproperty\(string-string-int-int\))
* [SearchIndexer.AddProperty(string, string, int, bool)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/addproperty.md#addproperty\(string-string-int-bool\))
* [SearchIndexer.AddProperty(string, string, int, int, bool)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/addproperty.md#addproperty\(string-string-int-int-bool\))
* [SearchIndexer.IsReady()](/engine/6000.7/script-reference/unityeditor/search/searchindexer/isready.md)
* [SearchIndexer.Search(string, int, int)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/search.md#search\(string-int-int\))
* [SearchIndexer.Search(SearchContext, SearchProvider, int, int)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/search.md#search\(searchcontext-searchprovider-int-int\))
* [SearchIndexer.SkipEntry(string, bool)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/skipentry.md)
* [SearchIndexer.IndexDocument(string, bool)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/indexdocument.md)
* [SearchIndexer.Merge(string\[\], SearchIndexer, int, Action\<int, SearchIndexer, int>)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/merge.md)
* [SearchIndexer.GetDocument(int)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/getdocument.md)
* [SearchIndexer.AddDocument(string, bool)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/adddocument.md#adddocument\(string-bool\))
* [SearchIndexer.AddDocument(string, string, string, bool, SearchDocumentFlags)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/adddocument.md#adddocument\(string-string-string-bool-searchdocumentflags\))
* [SearchIndexer.SetMetaInfo(string, string)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/setmetainfo.md)
* [SearchIndexer.GetMetaInfo(string)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/getmetainfo.md)
* [SearchIndexer.Start(bool)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/start.md)
* [SearchIndexer.Finish()](/engine/6000.7/script-reference/unityeditor/search/searchindexer/finish.md#finish\(\))
* [SearchIndexer.Finish(Action)](/engine/6000.7/script-reference/unityeditor/search/searchindexer/finish.md#finish\(action\))
* [SearchIndexer.Finish(Action, string\[\])](/engine/6000.7/script-reference/unityeditor/search/searchindexer/finish.md#finish\(action-string\))
* [SearchIndexer.Finish(string\[\])](/engine/6000.7/script-reference/unityeditor/search/searchindexer/finish.md#finish\(string\))
* [SearchIndexer.name](/engine/6000.7/script-reference/unityeditor/search/searchindexer/name.md)
* [SearchIndexer.timestamp](/engine/6000.7/script-reference/unityeditor/search/searchindexer/timestamp.md)
* [SearchIndexer.keywordCount](/engine/6000.7/script-reference/unityeditor/search/searchindexer/keywordcount.md)
* [SearchIndexer.documentCount](/engine/6000.7/script-reference/unityeditor/search/searchindexer/documentcount.md)
* [SearchIndexer.skipEntryHandler](/engine/6000.7/script-reference/unityeditor/search/searchindexer/skipentryhandler.md)
* [SearchIndexer.resolveDocumentHandler](/engine/6000.7/script-reference/unityeditor/search/searchindexer/resolvedocumenthandler.md)
* [SearchIndexer.minWordIndexationLength](/engine/6000.7/script-reference/unityeditor/search/searchindexer/minwordindexationlength.md)
* [SearchIndexer.minQueryLength](/engine/6000.7/script-reference/unityeditor/search/searchindexer/minquerylength.md)
