Yes. The Search expression system is different, in some ways, from the expression system used for calculated fields and columns. Conceptually, they're different.
For a Query, you're testing each file in the Library, one by one, against an expression and looking for a simple True/False result. The expression can access any field in the Library, but the output has to be True or False, to decide whether a particular file is included or excluded from the results list. True or false essentially correlate to 1 or 0. Though, really it correlates to:
So long as the query produces a true value (a value of 1), the file will be included.
Everything else is false, or just doesn't work at all.
A field expression (or column) outputs a string. It is, essentially, a text-replacement system. If you enter a particular field and you enter =[Field Name] it would just output itself. But you can use this to transform the contents of a field (amalgamating other fields, etc).
I think you know all of that, but the references here are fairly detailed (thanks to MrC and marko):
http://wiki.jriver.com/index.php/Smartlist_and_Search_-_Rules_and_Modifiershttp://wiki.jriver.com/index.php/Media_Center_expression_languageThe easiest way to test a search expression is with a Smartlist, of course. But while you are perfecting the search you can also easily make an Expression Column and paste the search query there. So, using your examples, I get:
Obviously no good.
So, if I tweak it so that:
=isequal([name],=ifelse(isequal([season],unknown season,8),,compare([season],=,0),[season],isrange(right([season],1),a-z),[season]/ ,isrange([season],1900-2100),[season]/ ,isrange(left([season],1),a-z),[season],IsRange([season],1-99),if(compare(left([season],1),=,0),removeleft([season],1),[season]))ifelse(isequal([episode],unknown episode,8),,IsRange([episode],1-9.9),if(compare(left([episode],1),=,0),[episode]/ ,0[episode]/ ),isequal([episode],-,8),if(compare(length([episode]),<=,4),0[episode]/ ,[episode]/ ),1,[episode]/ )if(isempty([episode title]),[name],[episode title]),1)
I get a nice clean line of zeros in the Expression 2 column. That means none match the query. But I still don't think that's what you want. I see in the above, you have a bunch of "unknown season" and other "default" values. That expression is so dense that I'm not going to expend the brainpower to figure out exactly what you want, but the idea is this:
You want to:
=If(IsEqual([field],expected value,<mode>),1,0)Or perhaps more likely (depending on your goals):
=If(IsEmpty([field],<mode>)1,0)Another tool that might be handy for this use is FirstNotEmpty, something like:
=If(IsEmpty(FirstNotEmpty([field1], [field2], [field3], 0),1),0,1)