release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Search | Go
Wiki > Main > PluginSearchengine

Searchengine

This plugin is outdated and not included in current builds. It worked with the old externally generated database which is now replaced by a new one (with an own search feature too),.

General

You are supposed to use the PluginDatabox to create search queries and you use this plugin to actually run those searches.

Items in blue are planned but not implemented yet.

Search Expression Language

Autorating is (playcount-playcountmin)*10/(playcountmax-playcountmin)

In EBNF:

NUMARG := number | numberid
STRARG := string | stringid

NUMOP : = '>' | '>=' | '<' | '<=' | '!=' | '=='
STROP : = CONTAINS | EQUALS | STARTSWITH | ENDSWITH

COMPARE : = NUMARG NUMOP NUMARG | STRARG STROP STRARG

EXPR := COMPARE | NOT EXPR | LPAREN MEXPR RPAREN

LEXPR := EXPR (AND EXPR)*

MEXPR := LEXPR (OR LEXPR)*

CLIPPING := PLAYTIME number | COUNT number

SORTTYPE := (LOWEST|HIGHEST) (rating | playcount | year | tracknumber)

QUERY := MEXPR (SORTBY SORTTYPE (AND SORTTYPE)*)? (CLIPBY CLIPPING)? (SHUFFLE)? EOF

numberid := year | rating | playcount | autorating | tracknumber
stringid := title | genre | artist | album | filename

Tokenfile description

Token Types

Token type ID Description
EOF 0 End of file / search
NOT 1 invert expression operator
AND 2 and expression operator
OR 3 or expression operator
GT 4 GreaterThan ( > ) number operator
GTE 5 GreaterThanorEqual ( >= ) number operator
LT 6 LessThan ( < ) number operator
LTE 7 LessThanorEqual ( <= ) number operator
EQ 8 Equal ( == ) number operator
NE 9 NotEqual ( = ) number operator
CONTAINS 10 contains string operator
EQUALS 11 equals string operator
STARTSWITH 12 startswith string operator
ENDSWITH 13 startswith string operator
LPAREN 14 '(' open new multiple-expression
RPAREN 15 ')' close previously opened multiple-expression
NUM 16 Number, value stored in intvalue
NUMID 17 Number property of a song, intvalue holds numberid (see NumberID intvalues)
STRING 18 String, stored in spelling
STRINGID 19 String property of a song, intvalue holds stringid (see StringID intvalues)
SHUFFLE 20 Shuffle results
PLAYTIMELIMIT 21 Limit playtime to # minutes (in intvalue)

Token Entry

Field Size Description
kind 1 Token type (see Token Types)
spelling 255 Text of a TOKEN_STRING
intvalue 4 Intvalue of this token

Token file

# Token Entries
1 EOF Token entry.
EOF

Todo

1) optimize album / artist names.
2) dynamic caching for targets with less ram (i have no idea how to do this (HCl))

Suggestion to change interface of searchengine and databox

(This is probably not really the right place to put this, maybe I should move it into an RFE? Sourceforge is acting up though...)

I propose that the code of the current two rocks are merged into one, in the following way:

The new plugin should be available both through the "View Plugins" menu, and the "Open with" menu. This is not possible right now, but probably shouldn't be too hard.

When running the plugin from the pluginlist, show a menu:

  • Create new search - opens edit mode
  • Saved searches - shows a list of searches in .rockbox/searches/ where "entering" each would work as if it was run in the filebrowser.

When running an .rsp file, show the menu (with the filename at the top, I guess):

  • Run and play - executes the query, add results to playlist
  • Run and save playlist - executes the query, asks for a filename and saves the .m3u
  • Edit - opens editmode

When the user has finished editing a search, show the following menu:

  • Run and play - executes the query, add results to playlist
  • Run and save playlist - executes the query, asks for a filename and saves the .m3u
  • Save searchfile - ask for filename (make the default .rockbox/searches/search.rsp), save an .rsp and quit

Results

The original use scenarios are still available

  • Creating an .rsp file by going into "View plugins".
  • Opening an .rsp file and saving a playlist (though with a single extra step).

Additionally, the following things become possible:

  • Creating running and playing a search in one go, without creating any files.
  • Creating a playlist of a search without having to first save the .rsp.
  • Editing, then saving a search without having to go into the menu.

I really think this would boost useability of the search


CategoryOldPlugin: Database Searchengine [PlayerDONE, RecorderDONE, OndioDONE, H100DONE, H300DONE, iPod 4GDONE, iPod ColorDONE, iPod NanoDONE, iPod VideoDONE]
r14 - 13 Apr 2007 - 09:45:37 - MarianneArnold
Copyright by the contributing authors.