2007/1/29, Jean-Francois Dockes <<a href="mailto:jean-francois.dockes@wanadoo.fr">jean-francois.dockes@wanadoo.fr</a>>:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Mikkel Kamstrup Erlandsen writes:<br> > 2007/1/29, Jean-Francois Dockes <<a href="mailto:jean-francois.dockes@wanadoo.fr">jean-francois.dockes@wanadoo.fr</a>>:<br> > ><br> > > Mikkel Kamstrup Erlandsen writes:
<br> > > > Hi All,<br> > > ><br> > > > I put together a first take on formalizing an end user search language.<br> > > ><br> > > > <a href="http://wiki.freedesktop.org/wiki/WasabiUserSearchLanguage">
http://wiki.freedesktop.org/wiki/WasabiUserSearchLanguage</a><br> > ><br> > > - Which of OR and AND has priority ? (does (A AND B OR C) mean<br> > > ((A AND B) OR C) or (A AND (B OR C)) ?<br> ><br>
><br> > I guess it is standard that AND takes precedence over OR, but maybe it makes<br> > sense to reverse that in our case. Think of the case<br> > type:audio hendrix OR beatles<br> ><br> > In this case I would assume the user wants "audio files matching hendrix or
<br> > beatles", and not "audio files matching hendrix, or anything that matches<br> > beatles"... I think it is non-standard however...</blockquote><div><br>Thinking more about this operator precedence issue... What about
<br><br>|| type:music jimi hendrix or beatles<br><br>If OR had precedence over AND that search would not yield the expected results...<br><br>Maybe a solution would be to simple put selectors completely out of logical scope with words and phrases. Always just AND them on to the expression. That way the search:
<br><br>|| type:music jimi hendrix or beatles filetype:mp3 or filetype:ogg<br><br>would give what is *probably* wanted...<br><br>A totally other approach would be to have AND take precedence and use "," to separate expressions that should be ANDed together. Example:
<br><br>|| type:music, jimi hendrix or beatles<br>|| type:music, jimi hendrix or beatles, filetype:mp3 or filetype:ogg<br><br>The last example translates to: (type:music) AND ((jimi AND hendrix) OR beatles) AND (filetype:mp3 OR filetype:ogg)
<br><br></div>I actually kinda like that. It keeps the conventional AND precedence and allows simple grouping of expressions.<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In our case, I think that you are right and that it makes more sense to<br>have OR take precedence, this has my vote.</blockquote><div><br>Are you still of the same opinion?<br><br>Cheers,<br>Mikkel <br></div><br></div><br>