Mailing List Archive

query language syntax differences for [query:?] vs. [[TicketQuery]]
Hello

I have been struggling with some differences in the query language for
[query:?] vs. [[TicketQuery]]. I might have misunderstand something. Or
maybe the documentation may need an improvement.

According to the documentation both [query:?] and [[TicketQuery]] share
the same query language:

https://trac.edgewall.org/wiki/TracQuery#QueryLanguage

However, first of all a major difference is the separator character.
While [query:?] needs `&`, the [[TicketQuery]] promotes `,` but also
accepts `&`.

Second difference is the position of the `=` match operator in regards
to other operators like `!` but also `~`. While [query:?] needs `=!`,
the [[TicketQuery]] accepts both variant `!=` and `=!`.

[query:?status=new&keywords=!foo tickets]

[[TicketQuery(status=new,keywords=!foo,count)]]

I guess there are technical and historic reasons for those differences.
[query:] seems close to the URL query format, and [[TicketQuery()]] as a
powerful macro seems more generous.

I do not complain and I am more than willing to accept. But it took me 2
hours to find out. I would propose (and volunteer) to add a small note
in the documentation, which would remind these differences. Something
like this:

> ... Filters are separated by ampersands (`&`); the `[[TicketQuery]]` macro also accepts comma (`,`).

> Note that for `query:` the match operator `=` needs to be on first position when combined with other operators, for example `=!` or `~=`.

If I have totally misunderstood something, please correct me.

Thanks
Clemens


P.S.

There is a very old related ticket #7699, but it did not come to a
conclusion.

https://trac.edgewall.org/ticket/7699

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/0aeb5651-c610-7fa6-d11a-1635072f3537%40osypkamed.com.
Re: query language syntax differences for [query:?] vs. [[TicketQuery]] [ In reply to ]
On Tuesday, May 24, 2022 at 3:52:53 AM UTC-7 Clemens Feige wrote:

> Hello
>
> I have been struggling with some differences in the query language for
> [query:?] vs. [[TicketQuery]]. I might have misunderstand something. Or
> maybe the documentation may need an improvement.
>
> According to the documentation both [query:?] and [[TicketQuery]] share
> the same query language:
>
> https://trac.edgewall.org/wiki/TracQuery#QueryLanguage
>
> However, first of all a major difference is the separator character.
> While [query:?] needs `&`, the [[TicketQuery]] promotes `,` but also
> accepts `&`.
>
> Second difference is the position of the `=` match operator in regards
> to other operators like `!` but also `~`. While [query:?] needs `=!`,
> the [[TicketQuery]] accepts both variant `!=` and `=!`.
>
> [query:?status=new&keywords=!foo tickets]
>
> [[TicketQuery(status=new,keywords=!foo,count)]]
>
> I guess there are technical and historic reasons for those differences.
> [query:] seems close to the URL query format, and [[TicketQuery()]] as a
> powerful macro seems more generous.
>
> I do not complain and I am more than willing to accept. But it took me 2
> hours to find out. I would propose (and volunteer) to add a small note
> in the documentation, which would remind these differences. Something
> like this:
>
> > ... Filters are separated by ampersands (`&`); the `[[TicketQuery]]`
> macro also accepts comma (`,`).
>
> > Note that for `query:` the match operator `=` needs to be on first
> position when combined with other operators, for example `=!` or `~=`.
>
> If I have totally misunderstood something, please correct me.
>
> Thanks
> Clemens
>
>
> P.S.
>
> There is a very old related ticket #7699, but it did not come to a
> conclusion.
>
> https://trac.edgewall.org/ticket/7699


I have found it confusing as well. I think you should feel free to go ahead
with the documentation edits.

Ryan

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/7714695b-f7a9-4389-b7ec-50e1c297fcfen%40googlegroups.com.
Re: Re: query language syntax differences for [query:?] vs. [[TicketQuery]] [ In reply to ]
RjOllos wrote on 27.05.2022 at 06:55:
>
> On Tuesday, May 24, 2022 at 3:52:53 AM UTC-7 Clemens wrote:
>
> Hello
>
> I have been struggling with some differences in the query language
> for
> [query:?] vs. [[TicketQuery]]. I might have misunderstand
> something. Or
> maybe the documentation may need an improvement.
>
> https://trac.edgewall.org/wiki/TracQuery#QueryLanguage
>
> [snip]
>
>
> I have found it confusing as well. I think you should feel free to go
> ahead with the documentation edits.
>
> Ryan
>

Done! I updated the "Query Language" section.

https://trac.edgewall.org/wiki/TracQuery?action=diff&version=61

Clemens

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/ea626d24-57ba-c434-f7f8-21d68bc3f2ef%40osypkamed.com.