INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Search Rules and Modifiers wiki page completed  (Read 3579 times)

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Search Rules and Modifiers wiki page completed
« on: January 19, 2013, 07:51:25 pm »

I've (finally) completed and posted my rewrite of the Search Rules and Modifiers wiki page:

    http://wiki.jriver.com/index.php/Smartlist_and_Search_-_Rules_and_Modifiers

Feedback and corrections encouraged.
Logged
The opinions I express represent my own folly.

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Search Rules and Modifiers wiki page completed
« Reply #1 on: January 20, 2013, 12:52:35 am »

Thanks! Great work, as always!

How about saying something about searching for empty and 0 values?

I seem to remember having some issues with entering decimal values in a search on my locale which is using comma as the decimal point. Could have been with date fields.

I take it you are waiting for some bug fixes before entering a main item explaining the range (-) operator.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Search Rules and Modifiers wiki page completed
« Reply #2 on: January 20, 2013, 02:08:47 am »

Great points.  I'll update to explain each of them.  Thanks!
Logged
The opinions I express represent my own folly.

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: Search Rules and Modifiers wiki page completed
« Reply #3 on: January 20, 2013, 02:38:07 am »

That looks good, my compliments!

Curious, I tried to replicate your example with "[Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead"", but it returned all three artists, I expected it to not return anything.

Are you sure that passage is correct or still applies to the current version? Or maybe I'm being thick again  :P
Logged

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Search Rules and Modifiers wiki page completed
« Reply #4 on: January 20, 2013, 05:30:37 am »

Yes, I see the same ([Artist]=[Queen] [Artist]=[Heart] [Artist]="Grateful Dead" returning all songs by those artists). But [Artist]=[Queen],[Bob Dylan] [Artist]=[Heart] [Artist]="Grateful Dead" returns nothing.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Search Rules and Modifiers wiki page completed
« Reply #5 on: January 20, 2013, 12:50:39 pm »

That looks good, my compliments!

Curious, I tried to replicate your example with "[Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead"", but it returned all three artists, I expected it to not return anything.

Are you sure that passage is correct or still applies to the current version? Or maybe I'm being thick again  :P

Thanks.

I'm not sure I follow you regarding expect this to return nothing.

When entered as Search Text, both the more liberal:

   [Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead"

and the more formal and correct:

   ([Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead")

produces tracks from all three artists.  These are OR operations, so should produce all tracks from any of the three.

If you now hit the Wizard, then the first will get incorrectly translated into AND operations, and you will get nothing returned.  The later will work correct.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Search Rules and Modifiers wiki page completed
« Reply #6 on: January 20, 2013, 12:58:33 pm »

... But [Artist]=[Queen],[Bob Dylan] [Artist]=[Heart] [Artist]="Grateful Dead" returns nothing.

As written, these are AND operations, so would produce nothing.  You'd want:

[Artist]=[Queen],[Bob Dylan] or [Artist]=[Heart] or [Artist]="Grateful Dead"
Logged
The opinions I express represent my own folly.

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Search Rules and Modifiers wiki page completed
« Reply #7 on: January 20, 2013, 01:06:04 pm »

I am not sure I understand. This entered in the search field or import/export dialog returns songs from all named artists (not nothing):
[Artist]=[Queen] [Artist]=[Heart] [Artist]="Grateful Dead"

This, on the other hand, entered the same ways returns nothing (as expected):
[Artist]=[Queen],[Bob Dylan] [Artist]=[Heart] [Artist]="Grateful Dead"
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Search Rules and Modifiers wiki page completed
« Reply #8 on: January 20, 2013, 01:20:40 pm »

I am not sure I understand. This entered in the search field or import/export dialog returns songs from all named artists (not nothing):
[Artist]=[Queen] [Artist]=[Heart] [Artist]="Grateful Dead"

I see exactly the opposite.

Maybe we're talking about different places for the text entry.  In the upper right Search box, there are two modes: Text and Wizard.  If you copy/paste your expression above into that box directly, you should see no results.  I also get no results when pasting exactly that in Import/Export.

Your results don't make sense to me, because the default mode of combining search terms is AND.  You're saying you see results as if OR operations are being defined.
Logged
The opinions I express represent my own folly.

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: Search Rules and Modifiers wiki page completed
« Reply #9 on: January 20, 2013, 01:21:56 pm »

Thanks.

I'm not sure I follow you regarding expect this to return nothing.

When entered as Search Text, both the more liberal:

   [Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead"

and the more formal and correct:

   ([Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead")

produces tracks from all three artists.  These are OR operations, so should produce all tracks from any of the three.

If you now hit the Wizard, then the first will get incorrectly translated into AND operations, and you will get nothing returned.  The later will work correct.

Because you wrote (I added emphasis :P) so I didn't expect it to work:

Quote
For example, the loosely written three-term search query using the or operator

    [Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead"

will be incorrectly translated by Search Wizard into a three-term and operation

    [Artist]=[Queen] [Artist]=[Heart] [Artist]="Grateful Dead"

This is not happening, and the query just works.
Logged

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: Search Rules and Modifiers wiki page completed
« Reply #10 on: January 20, 2013, 01:27:54 pm »

Ah I think I see what you mean. In the screenshot you can see the wizard turns it into "is any", but when you run it it retuns nothing. It doesn't import the brackets for 'or'.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Search Rules and Modifiers wiki page completed
« Reply #11 on: January 20, 2013, 01:30:04 pm »

Maybe we're encountering a wrinkle or difference due to different language settings?

Its like both InflatableMouse and vagskal's searches are defaulting to using OR operations instead of AND.

See the attached screenshot.  I paste into the Text area exactly:

   [Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead"

and all three artist's tracks are returned.  Then I hit Wizard with that text applied (shown in screenshot), and you can see the results are now AND operations (note that there are no parens included).  When I hit Apply, all tracks disappear.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Search Rules and Modifiers wiki page completed
« Reply #12 on: January 20, 2013, 01:31:32 pm »

Ah I think I see what you mean. In the screenshot you can see the wizard turns it into "is any", but when you run it it retuns nothing. It doesn't import the brackets for 'or'.

Bingo.  And that would be the flaw in Text --> Wizard translation I documented.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Search Rules and Modifiers wiki page completed
« Reply #13 on: January 20, 2013, 01:38:41 pm »

It occurs to me also that I should make clearer the concept of AND and OR, as ordinary language confounds these mathematical terms.

In ordinary language, one could read Artist=Queen and Artist=Heart to mean, "Yes, I want Queen and I want Heart".  But it really means "Artist must be Queen AND Artist must be Heart", at the same time, an impossibility.
Logged
The opinions I express represent my own folly.

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: Search Rules and Modifiers wiki page completed
« Reply #14 on: January 20, 2013, 01:47:49 pm »

Oke I'll confess something ... I try to use the wizard as little as possible because I don't like it.

So the first time I checked the search example you gave, I entered the text into the wizard but never applied it, I cancelled the wizard when I saw it translated to 'is any' and incorrectly assumed 'or'. I still can't get used to how 'and' and 'or' works there. I think its one of the most unintuitive and even counter-productive parts of MC.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Search Rules and Modifiers wiki page completed
« Reply #15 on: January 20, 2013, 02:02:03 pm »

Good that we got to the bottom of this.  Thanks.

The unintuitive part being the hidden parens?  I agree.  This would be much clearer with something that indicates you can click there, minimally.  There are better interfaces to show AND/OR relationships across a series of clauses.

As an aside, the "is any" applies to a list, meaning is the term in any of the list items.
Logged
The opinions I express represent my own folly.

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Search Rules and Modifiers wiki page completed
« Reply #16 on: January 20, 2013, 04:32:12 pm »

I've updated the page.

vagskal - if you have more info, prose, or examples on locale issues and search, I'd appreciate some.

Added:
  - Added Search and Locale section
  - Clarify empty and 0 values
  - Indicate how to search for empty values
  - Clarify AND and OR: mathematical vs. common language usage
  - Fixed fonts in Examples, and Limitations and Bugs sections.
  - Added a few more items to Limitations and Bugs section
Logged
The opinions I express represent my own folly.

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Search Rules and Modifiers wiki page completed
« Reply #17 on: January 20, 2013, 05:12:39 pm »

I will look closer at this tomorrow and response. It is late now in my time zone, and I have been busy with other stuff.

Great job with the wiki page, MrC!
Logged

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Search Rules and Modifiers wiki page completed
« Reply #18 on: January 21, 2013, 03:13:44 am »

Its like both InflatableMouse and vagskal's searches are defaulting to using OR operations instead of AND.

See the attached screenshot.  I paste into the Text area exactly:

   [Artist]=[Queen] or [Artist]=[Heart] or [Artist]="Grateful Dead"

and all three artist's tracks are returned.  Then I hit Wizard with that text applied (shown in screenshot), and you can see the results are now AND operations (note that there are no parens included).  When I hit Apply, all tracks disappear.

OK, I see the same as you and like InflatableMouse I did not Apply the resultant search I had not altered. Sorry.
Logged

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978
Re: Search Rules and Modifiers wiki page completed
« Reply #19 on: January 21, 2013, 03:15:45 am »

I'd say something along the lines of 'great minds think alike', but I don't think it would be appropriate in this situation.  ;D
Logged

vagskal

  • Citizen of the Universe
  • *****
  • Posts: 1227
Re: Search Rules and Modifiers wiki page completed
« Reply #20 on: January 21, 2013, 03:43:22 am »

vagskal - if you have more info, prose, or examples on locale issues and search, I'd appreciate some.

For me on Swedish locale searching date fields (Date, Last Played etc) is not working properly.

Searching with y and d values works (like [Date]=<5y). For decimal values (like [Last Played]=<0.5d) I have to use dot instead of comma according to the locale.

Anything requiring a full or partial date is not working on date fields with iso dates (yyyy-mm-dd). Entering a full date in this format (which is not correct according to Swedish locale) mm/dd/yyyy works.

Entering just the year as it is displayed in the date field ([Date]=2012) is not working. Entering [Date]=01/01/2012 works.

____

Using d, y etc after a zero is not working: [Last Played]=0-0.5d works (and returns songs never played or played in the last 12 hours) but [Last Played]=0d-0.5d returns nothing.

Edit: And when you come to the range operator you might want to say something about escaping - in searches ([Date Born]=[1867/-04/-12]).
Logged
Pages: [1]   Go Up