docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ObjectIndexer

    Specialized SearchIndexer used to index Unity Assets. See AssetIndexer for a specialized SearchIndexer used to index simple assets and see SceneIndexer for an indexer used to index scene and prefabs.

    Inheritance
    object
    SearchIndexer
    ObjectIndexer
    Inherited Members
    SearchIndexer.name
    SearchIndexer.keywordCount
    SearchIndexer.documentCount
    SearchIndexer.skipEntryHandler
    SearchIndexer.resolveDocumentHandler
    SearchIndexer.minWordIndexationLength
    SearchIndexer.AddWord(string, int, int)
    SearchIndexer.AddWord(string, int, int, int)
    SearchIndexer.AddExactWord(string, int, int)
    SearchIndexer.AddWord(string, int, int, int, int)
    SearchIndexer.AddNumber(string, double, int, int)
    SearchIndexer.AddProperty(string, string, int, bool, bool)
    SearchIndexer.AddProperty(string, string, int, int, bool, bool)
    SearchIndexer.AddProperty(string, string, int, int, int, int, bool, bool)
    SearchIndexer.IsReady()
    SearchIndexer.Search(string, int, int)
    SearchIndexer.Search(SearchContext, SearchProvider, int, int)
    SearchIndexer.Write(Stream)
    SearchIndexer.SaveBytes()
    SearchIndexer.Read(Stream, bool)
    SearchIndexer.LoadBytes(byte[], Action<bool>)
    SearchIndexer.GetDocument(int)
    SearchIndexer.AddDocument(string, bool)
    SearchIndexer.SetMetaInfo(string, string)
    SearchIndexer.GetMetaInfo(string)
    SearchIndexer.Start(bool)
    SearchIndexer.Finish()
    SearchIndexer.Finish(Action)
    SearchIndexer.Finish(Action<byte[]>, string[])
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.Search
    Assembly: com.unity.quicksearch.dll
    Syntax
    public abstract class ObjectIndexer : SearchIndexer

    Methods

    GetEntryComponents(string, int)

    Splits a string into multiple words that will be indexed. It works with paths and UpperCamelCase strings.

    Declaration
    public virtual IEnumerable<string> GetEntryComponents(string entry, int documentIndex)
    Parameters
    Type Name Description
    string entry

    The string to be split.

    int documentIndex

    The document index that will index that entry.

    Returns
    Type Description
    IEnumerable<string>

    The entry components.

    IndexDocument(string, bool)

    Function to override in a concrete SearchIndexer to index the content of a document.

    Declaration
    public override abstract void IndexDocument(string id, bool checkIfDocumentExists)
    Parameters
    Type Name Description
    string id

    Path of the document to index.

    bool checkIfDocumentExists

    Check if the document actually exists.

    Overrides
    SearchIndexer.IndexDocument(string, bool)

    IndexNumber(int, string, double)

    Add a key-number value pair to the index. The key won't be added with variations. See AddNumber(string, double, int, int).

    Declaration
    public void IndexNumber(int documentIndex, string name, double number)
    Parameters
    Type Name Description
    int documentIndex

    Document where the indexed value was found.

    string name

    Key used to retrieve the value.

    double number

    Number value to store in the index.

    IndexObject(int, Object, bool)

    Index all the properties of an object.

    Declaration
    protected void IndexObject(int documentIndex, Object obj, bool dependencies = false)
    Parameters
    Type Name Description
    int documentIndex

    Document where the indexed object was found.

    Object obj

    Object to index.

    bool dependencies

    Index dependencies.

    IndexProperty(int, string, string, bool, bool)

    Add a property value to the index. A property is specified with a key and a string value. The value will be stored with multiple variations. See AddProperty(string, string, int, bool, bool).

    Declaration
    public void IndexProperty(int documentIndex, string name, string value, bool saveKeyword, bool exact = false)
    Parameters
    Type Name Description
    int documentIndex

    Document where the indexed word was found.

    string name

    Key used to retrieve the value. See AddProperty(string, string, int, bool, bool)

    string value

    Value to add to the index.

    bool saveKeyword

    Define if we store this key in the keyword registry of the index. See GetKeywords().

    bool exact

    If exact is true, only the exact match of the value will be stored in the index (not the variations).

    IndexPropertyComponents(int, string, string)

    Split a value into multiple components.

    Declaration
    public void IndexPropertyComponents(int documentIndex, string name, string value)
    Parameters
    Type Name Description
    int documentIndex

    Document where the indexed word was found.

    string name

    Key used to retrieve the value. See AddProperty(string, string, int, bool, bool)

    string value

    Value to add to the index.

    IndexWord(int, string, bool, int)

    Add a new word coming from a specific document to the index. The word will be added with multiple variations allowing partial search. See AddWord(string, int, int).

    Declaration
    public void IndexWord(int documentIndex, string word, bool exact = false, int scoreModifier = 0)
    Parameters
    Type Name Description
    int documentIndex

    Document where the indexed word was found.

    string word

    Word to add to the index.

    bool exact

    If true, we will store also an exact match entry for this word.

    int scoreModifier

    Modified to apply to the base score for a specific word.

    IndexWord(int, string, int, bool, int)

    Add a new word coming from a specific document to the index. The word will be added with multiple variations allowing partial search. See AddWord(string, int, int).

    Declaration
    public void IndexWord(int documentIndex, string word, int maxVariations, bool exact, int scoreModifier = 0)
    Parameters
    Type Name Description
    int documentIndex

    Document where the indexed word was found.

    string word

    Word to add to the index.

    int maxVariations

    Maximum number of variations to compute. Cannot be higher than the length of the word.

    bool exact

    If true, we will store also an exact match entry for this word.

    int scoreModifier

    Modified to apply to the base score for a specific word.

    IndexWordComponents(int, string)

    Split a word into multiple components.

    Declaration
    public void IndexWordComponents(int documentIndex, string word)
    Parameters
    Type Name Description
    int documentIndex

    Document where the indexed word was found.

    string word

    Word to add to the index.

    Search(string, SearchContext, SearchProvider, int, int)

    Run a search query in the index.

    Declaration
    public override IEnumerable<SearchResult> Search(string searchQuery, SearchContext context, SearchProvider provider, int maxScore = 2147483647, int patternMatchLimit = 2999)
    Parameters
    Type Name Description
    string searchQuery

    Search query to look out for. If if matches any of the indexed variations a result will be returned.

    SearchContext context

    The search context on which the query is applied.

    SearchProvider provider

    The provider that initiated the search.

    int maxScore

    Maximum score of any matched Search Result. See score.

    int patternMatchLimit

    Maximum number of matched Search Result that can be returned. See SearchResult.

    Returns
    Type Description
    IEnumerable<SearchResult>

    Returns a collection of Search Result matching the query.

    Overrides
    SearchIndexer.Search(string, SearchContext, SearchProvider, int, int)

    SkipEntry(string, bool)

    Called when the index is built to see if a specified document needs to be indexed. See skipEntryHandler

    Declaration
    public override bool SkipEntry(string path, bool checkRoots = false)
    Parameters
    Type Name Description
    string path

    Path of a document

    bool checkRoots
    Returns
    Type Description
    bool

    Returns true if the document doesn't need to be indexed.

    Overrides
    SearchIndexer.SkipEntry(string, bool)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)