Version 1 (modified by trac, 3 years ago) (diff)

--

Trac Ticket Queries

In addition to reports, Trac provides support for custom ticket queries, used to display lists of tickets meeting a specified set of criteria.

To configure and execute a custom query, switch to the View Tickets module from the navigation bar, and select the Custom Query link.

Filters

When you first go to the query page the default filters will display all open tickets, or if you're logged in it will display open tickets assigned to you. Current filters can be removed by clicking the button to the right with the minus sign on the label. New filters are added from the pulldown list in the bottom-right corner of the filters box. Filters with either a text box or a pulldown menu of options can be added multiple times to perform an or of the criteria.

You can use the fields just below the filters box to group the results based on a field, or display the full description for each ticket.

Once you've edited your filters click the Update button to refresh your results.

Clicking on one of the query results will take you to that ticket. You can navigate through the results by clicking the Next Ticket or Previous Ticket links just below the main menu bar, or click the Back to Query link to return to the query page.

You can safely edit any of the tickets and continue to navigate through the results using the Next/Previous/Back? to Query links after saving your results. When you return to the query any tickets which were edited will be displayed with italicized text. If one of the tickets was edited such that it no longer matches the query criteria the text will also be greyed. Lastly, if a new ticket matching the query criteria has been created, it will be shown in bold.

The query results can be refreshed and cleared of these status indicators by clicking the Update button again.

Saving Queries

While Trac does not yet allow saving a named query and somehow making it available in a navigable list, you can save references to queries in Wiki content, as described below.

You may want to save some queries so that you can come back to them later. You can do this by making a link to the query from any Wiki page.

[query:status=new|assigned|reopened&version=1.0 Active tickets against 1.0]

Which is displayed as:

Active tickets against 1.0

This uses a very simple query language to specify the criteria (see Query Language).

Alternatively, you can copy the query string of a query and paste that into the Wiki link, including the leading ? character:

[query:?status=new&status=assigned&status=reopened&group=owner Assigned tickets by owner]

Which is displayed as:

Assigned tickets by owner

Using the [[TicketQuery]] Macro

The TicketQuery macro lets you display lists of tickets matching certain criteria anywhere you can use WikiFormatting.

Example:

[[TicketQuery(version=0.6|0.7&resolution=duplicate)]]

This is displayed as:

No results

Just like the query: wiki links, the parameter of this macro expects a query string formatted according to the rules of the simple ticket query language.

A more compact representation without the ticket summaries is also available:

[[TicketQuery(version=0.6|0.7&resolution=duplicate, compact)]]

This is displayed as:

No results

Finally if you wish to receive only the number of defects that match the query using the count parameter.

[[TicketQuery(version=0.6|0.7&resolution=duplicate, count)]]

This is displayed as:

0

Customizing the table format

You can also customize the columns displayed in the table format (format=table) by using col=<field> - you can specify multiple fields and what order they are displayed by placing pipes (|) between the columns like below:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter)]]

This is displayed as:

Full rows

In table format you can also have full rows by using rows=<field> like below:

[[TicketQuery(max=3,status=closed,order=id,desc=1,format=table,col=resolution|summary|owner|reporter,rows=description)]]

This is displayed as:

Results (1 - 3 of 235)

1 2 3 4 5 6 7 8 9 10 11
Ticket Resolution Summary Owner Reporter
#322 fixed Typo in Indexer Documentation? nachtbus@…

Reported by nachtbus@…, 17 months ago.

Description

Hi, http://docs.outerthought.org/lily-docs-current/415-lily/551-lily.html proposes to copy the indexer config over the solr schema:

cp {lily}/samples/dynamic_indexerconf/dynamic_indexerconf.xml \
   {solr}/example/solr/conf/schema.xml

Shouldn't it be

cp {lily}/samples/dynamic_indexerconf/dynamic_solr_schema.xml \
   {solr}/example/solr/conf/schema.xml
#315 fixed Schema cache: Node crash could cause missed schema cache refresh triggers evert evert

Reported by evert, 19 months ago.

Description

When a type update happens, the related bucket zookeeper node is updated so that the schema caches would get informed that they should updated their caches.

If updating this zookeeper node fails, the schema caches would not get informed. Updating the zookeeper node is done in a retry-loop, so in case of a temporary connection failure with zookeeper, the update will still happen in the end.

So the only situation when this scenario could happen is when after updating the type, but before updating the zookeeper node the lily node would crash.

Here's an algorithm on how we could avoid such missed refresh triggers:

  • Use a HBase counter on a row with as row-key the bucket byte
  • Before putting the record type or field type row, increment the counter (= extra put operation!)
  • Update the actual row
  • Update the bucket zookeeper node and put the counter in the data. Do this in a retry-loop with a conditional update on zookeeper until the zookeeper node contains the highest counter
  • Use watchers on the /lily/nodes zookeeper node. When a lily node disappears, this could be because of a lily node crash and the caches could be out of date.
  • Refresh all caches for the buckets for which the counter in HBase is higher than the counter in zookeeper.

Alternatively we could skip the counter and just refresh all caches completely each time a lily node disappears.

#310 invalid Exception in IndexUpdater when importing book_sample.json bruno hungtheduong@…

Reported by hungtheduong@…, 19 months ago.

Description

Hi, I followed the instruction to start Lily here http://docs.outerthought.org/lily-docs-current/414-lily.html

When looking at Lily's server log, I saw this exception. When query for Frankenstein in solr admin, it return no resukt.. Please help. Thank you.

[INFO ][14:37:48,360][main ] org.kauriproject.runtime.info - Kauri Runtime started [October 22, 2011 2:37:48 PM PDT] [DEBUG][14:38:35,508][orker #2-1] org.lilyproject.indexer.engine.IndexUpdater? - Received message: {"type":"repo:record-created","updatedFields":["bgkjy32VQa+bnGLvz0nwcQ==","jT1mtAPHSmmAxBXQD2Boew==","HHU5OajkQRi5Q8rGvsrGpA==","EOu3kjW7QEmHSQE5WVbv4Q=="],"versionCreated":1} [ERROR][14:38:35,564][orker #2-1] org.lilyproject.indexer.engine.IndexUpdater? - Failure in IndexUpdater?. Record 'UUID.084e2557-f23e-4293-bc79-10086900871e', event type CREATE org.lilyproject.indexer.engine.SolrClientException?: Error performing operation on Solr http://localhost:2181/solr

at org.lilyproject.indexer.engine.SolrClientImpl?.add(SolrClientImpl?.java:35) at sun.reflect.NativeMethodAccessorImpl?.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl?.invoke(NativeMethodAccessorImpl?.java:39) at sun.reflect.DelegatingMethodAccessorImpl?.invoke(DelegatingMethodAccessorImpl?.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.lilyproject.indexer.engine.RetryingSolrClient?$RetryingSolrClientInvocationHandler?.invoke(RetryingSolrClient?.java:47) at $Proxy21.add(Unknown Source) at org.lilyproject.indexer.engine.Indexer.index(Indexer.java:240) at org.lilyproject.indexer.engine.Indexer.index(Indexer.java:133) at org.lilyproject.indexer.engine.IndexUpdater?.handleRecordCreateUpdate(IndexUpdater?.java:320) at org.lilyproject.indexer.engine.IndexUpdater?.processMessage(IndexUpdater?.java:173) at org.lilyproject.rowlog.impl.RemoteListenerHandler?$MessageHandler?.messageReceived(RemoteListenerHandler?.java:159) at org.jboss.netty.channel.SimpleChannelUpstreamHandler?.handleUpstream(SimpleChannelUpstreamHandler?.java:80) at org.jboss.netty.channel.DefaultChannelPipeline?.sendUpstream(DefaultChannelPipeline?.java:545) at org.jboss.netty.channel.DefaultChannelPipeline?$DefaultChannelHandlerContext?.sendUpstream(DefaultChannelPipeline?.java:754) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:287) at org.lilyproject.rowlog.impl.RemoteListenerHandler?$RowLogMessageDecoder?.messageReceived(RemoteListenerHandler?.java:151) at org.jboss.netty.channel.SimpleChannelUpstreamHandler?.handleUpstream(SimpleChannelUpstreamHandler?.java:80) at org.jboss.netty.channel.DefaultChannelPipeline?.sendUpstream(DefaultChannelPipeline?.java:545) at org.jboss.netty.channel.DefaultChannelPipeline?$DefaultChannelHandlerContext?.sendUpstream(DefaultChannelPipeline?.java:754) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302) at org.jboss.netty.handler.codec.frame.FrameDecoder?.unfoldAndFireMessageReceived(FrameDecoder?.java:317) at org.jboss.netty.handler.codec.frame.FrameDecoder?.callDecode(FrameDecoder?.java:299) at org.jboss.netty.handler.codec.frame.FrameDecoder?.messageReceived(FrameDecoder?.java:216) at org.jboss.netty.channel.SimpleChannelUpstreamHandler?.handleUpstream(SimpleChannelUpstreamHandler?.java:80) at org.jboss.netty.channel.DefaultChannelPipeline?.sendUpstream(DefaultChannelPipeline?.java:545) at org.jboss.netty.channel.DefaultChannelPipeline?.sendUpstream(DefaultChannelPipeline?.java:540) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261) at org.jboss.netty.channel.socket.nio.NioWorker?.read(NioWorker?.java:349) at org.jboss.netty.channel.socket.nio.NioWorker?.processSelectedKeys(NioWorker?.java:280) at org.jboss.netty.channel.socket.nio.NioWorker?.run(NioWorker?.java:200) at org.jboss.netty.util.ThreadRenamingRunnable?.run(ThreadRenamingRunnable?.java:108) at org.jboss.netty.util.internal.DeadLockProofWorker?$1.run(DeadLockProofWorker?.java:44) at java.util.concurrent.ThreadPoolExecutor?$Worker.runTask(ThreadPoolExecutor?.java:886) at java.util.concurrent.ThreadPoolExecutor?$Worker.run(ThreadPoolExecutor?.java:908) at java.lang.Thread.run(Thread.java:662)

Caused by: org.apache.solr.client.solrj.SolrServerException?: org.apache.commons.httpclient.ProtocolException?: Unbuffered entity enclosing request can not be repeated.

at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer?.request(CommonsHttpSolrServer?.java:481) at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer?.request(CommonsHttpSolrServer?.java:245) at org.apache.solr.client.solrj.request.AbstractUpdateRequest?.process(AbstractUpdateRequest?.java:105) at org.apache.solr.client.solrj.SolrServer?.add(SolrServer?.java:64) at org.lilyproject.indexer.engine.SolrClientImpl?.add(SolrClientImpl?.java:33) ... 36 more

Caused by: org.apache.commons.httpclient.ProtocolException?: Unbuffered entity enclosing request can not be repeated.

at org.apache.commons.httpclient.methods.EntityEnclosingMethod?.writeRequestBody(EntityEnclosingMethod?.java:487) at org.apache.commons.httpclient.HttpMethodBase?.writeRequest(HttpMethodBase?.java:2114) at org.apache.commons.httpclient.HttpMethodBase?.execute(HttpMethodBase?.java:1096) at org.apache.commons.httpclient.HttpMethodDirector?.executeWithRetry(HttpMethodDirector?.java:398) at org.apache.commons.httpclient.HttpMethodDirector?.executeMethod(HttpMethodDirector?.java:171) at org.apache.commons.httpclient.HttpClient?.executeMethod(HttpClient?.java:397) at org.apache.commons.httpclient.HttpClient?.executeMethod(HttpClient?.java:323) at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer?.request(CommonsHttpSolrServer?.java:428) ... 40 more

1 2 3 4 5 6 7 8 9 10 11

Query Language

query: TracLinks and the [[TicketQuery]] macro both use a mini “query language” for specifying query filters. Basically, the filters are separated by ampersands (&). Each filter then consists of the ticket field name, an operator, and one or more values. More than one value are separated by a pipe (|), meaning that the filter matches any of the values.

The available operators are:

= the field content exactly matches the one of the values
~= the field content contains one or more of the values
^= the field content starts with one of the values
$= the field content ends with one of the values

All of these operators can also be negated:

!= the field content matches none of the values
!~= the field content does not contain any of the values
!^= the field content does not start with any of the values
!$= the field content does not end with any of the values

See also: TracTickets, TracReports, TracGuide