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



Search | Go
Wiki > Main > PluginSearchengine (r11)

Searchengine

General

Items in blue are planned but not implemented yet.

Search Expression Language

FILTER is an special AND only allowed at the end...
-traverse result, put all indexes with 1 in an array. select random items from indexarray till time limit reached or all items selected, put in new clean boolean array.return as result to and with...-
-what about selecting modes? random, first, last.. ? first and last are trivial to implement..
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)*

QUERY := MEXPR (SHUFFLE)? (PLAYTIMELIMIT)? EOF

numberid := year | rating | playcount | autorating
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))


CategoryPlugin: Database Searchengine [PlayerDONE, RecorderDONE, OndioDONE, iRiverDONE]
Edit | Attach | Print version | History: r14 | r12 < r11 < r10 < r9 | Backlinks | View wiki text | More topic actions...
r11 - 22 May 2005 - 17:02:52 - MichielVanDerKolk
Copyright by the contributing authors.