### Class

# RB SourceSearch

#### Description [src]

    class RB.SourceSearch : GObject.Object
    {
      /* No available fields */
    }

These translate the text in the search entry box into a RhythmDBQuery. The basic implementation will return a query like RHYTHMDB_QUERY_PROP_LIKE, RHYTHMDB_PROP_SEARCH_MATCH, text. Simple variants can restrict the search to single properties (artist, album, genre). More complicated searches could implement something like the Xesam User Query spec.

The source header finds the search instance to use by looking for the ‘rb-source-search’ data item on the active search action.

#### Ancestors

- GObject

#### Descendants

- RBSourceSearchBasic

#### Functions

###### rb_source_search_add_to_menu

Adds a registered search instance to a search menu.

###### rb_source_search_get_by_name

Finds the registered search instance with the specified name.

#### Instance methods

###### rb_source_search_create_query

Creates a `RhythmDBQuery` from the user’s search text.

###### rb_source_search_get_description

Returns a description of the search suitable for displaying in a menu.

###### rb_source_search_is_subset

Determines whether the new search text will result in a subset of entries matched by the previous search. This is used to optimise the search query.

###### rb_source_search_register

Registers a named search instance that can be used in menus and search action states.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct RBSourceSearchClass {
      GObjectClass parent_class;
      GHashTable* searches;
      gboolean (* is_subset) (
        RBSourceSearch* search,
        const char* current,
        const char* next
      );
      RhythmDBQuery* (* create_query) (
        RBSourceSearch* search,
        RhythmDB* db,
        const char* search_text
      );
      char* (* get_description) (
        RBSourceSearch* search
      );

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`searches: GHashTable*`

  No description available.

`is_subset: gboolean (* is_subset) ( RBSourceSearch* search, const char* current, const char* next )`

  No description available.

`create_query: RhythmDBQuery* (* create_query) ( RBSourceSearch* search, RhythmDB* db, const char* search_text )`

  No description available.

`get_description: char* (* get_description) ( RBSourceSearch* search )`

  No description available.

#### Virtual methods

###### RB.SourceSearchClass.create_query

Creates a `RhythmDBQuery` from the user’s search text.

###### RB.SourceSearchClass.get_description

Returns a description of the search suitable for displaying in a menu.

###### RB.SourceSearchClass.is_subset

Determines whether the new search text will result in a subset of entries matched by the previous search. This is used to optimise the search query.