# IndexWordComponents(int, in string)

> Splits a word into multiple variations.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Search](/engine/6000.7/script-reference/unityeditor/search.md)
* **Assembly:** UnityEditor

## IndexWordComponents(int, string)

```csharp
public void IndexWordComponents(int documentIndex, in string word)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Document where the indexed word was found.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Word to add to the index.

### Remarks

See [IndexPropertyComponents](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexpropertycomponents.md) for some examples on how a value can be split into multiple variations. [IndexWordComponents](/engine/6000.7/script-reference/unityeditor/search/objectindexer/indexwordcomponents.md) performs the same task for words.

### Examples

```csharp
using UnityEditor;
using UnityEditor.Search;

static class Example_ObjectIndexer_IndexWordComponents
{
    #region CustomObjectIndexer
    [CustomObjectIndexer(typeof(SceneAsset), version = 2 /* update me when the code below changes */)]
    internal static void IndexSceneName(CustomObjectIndexerTarget context, ObjectIndexer indexer)
    {
        if (!(context.target is SceneAsset sceneAsset))
            return;

        indexer.IndexWordComponents(context.documentIndex, sceneAsset.name);
    }

    #endregion
}
```
