# SearchDocument

> Represents a searchable document that has been indexed.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEditor.Search](/engine/6000.7/script-reference/unityeditor/search.md)
* **Assembly:** UnityEditor
* **Implements:** [IEquatable\<SearchDocument>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [IComparable\<SearchDocument>](https://learn.microsoft.com/dotnet/api/system.icomparable-1)

```csharp
public readonly struct SearchDocument : IEquatable<SearchDocument>, IComparable<SearchDocument>
```

## Fields

| Value                                                                               | Description                             |
| ----------------------------------------------------------------------------------- | --------------------------------------- |
| [id](/engine/6000.7/script-reference/unityeditor/search/searchdocument/id.md)       | Document unique ID in the search index. |
| [score](/engine/6000.7/script-reference/unityeditor/search/searchdocument/score.md) | Document base relevance score.          |

## Constructors

| Constructor                                                                                                                                                                                    | Description                  |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| [SearchDocument(System.String,System.String,System.String,System.Int32)](/engine/6000.7/script-reference/unityeditor/search/searchdocument/ctor.md#searchdocument\(string-string-string-int\)) | Create a new SearchDocument. |
| [SearchDocument(UnityEditor.Search.SearchDocument,System.Int32)](/engine/6000.7/script-reference/unityeditor/search/searchdocument/ctor.md#searchdocument\(searchdocument-int\))               | Create a new SearchDocument. |
| [SearchDocument(UnityEditor.Search.SearchDocument,System.String)](/engine/6000.7/script-reference/unityeditor/search/searchdocument/ctor.md#searchdocument\(searchdocument-string\))           | Create a new SearchDocument. |

## Properties

| Property                                                                              | Description                                                                                                                                            |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [name](/engine/6000.7/script-reference/unityeditor/search/searchdocument/name.md)     | Readable name of the document.                                                                                                                         |
| [source](/engine/6000.7/script-reference/unityeditor/search/searchdocument/source.md) | Original source from which the document was indexed. The source is usually the container asset, i.e. prefab, Unity scene or the imported asset itself. |
| [valid](/engine/6000.7/script-reference/unityeditor/search/searchdocument/valid.md)   | If true the document is considered valid.                                                                                                              |

## Methods

| Method                                                                                      | Description                                     |
| ------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| [CompareTo](/engine/6000.7/script-reference/unityeditor/search/searchdocument/compareto.md) | Compare this document against another document. |
| [Equals](/engine/6000.7/script-reference/unityeditor/search/searchdocument/equals.md)       | Compare this document against another document. |
| [ToString](/engine/6000.7/script-reference/unityeditor/search/searchdocument/tostring.md)   | Returns the document ID string.                 |
