Tuesday, July 3, 2012

Jira full text search tips

One of the advantages of using Jira at Eucalyptus is that it has very good Lucene-based full-text search.  It's not necessarily obvious how to use it, though.  If you want to search for a multi-word string, you have to use the advanced search (JQL), and quote it like this:

text ~ "\"disk space\""

if you only want to find the individual words rather than the exact string, remove the escaped quotes:

text ~ "disk space"

The first query returns about 4 results for me, while the second returns dozens, so the subtle difference can be very important.

More search tips here.

Just be aware that most of those tips don't seem to work via "quick search".  You have use them inside quotes in a JQL search.  I tested things like:

text ~ "\"disk space\"~10"  (disk and space within ten words of each other)
text ~ "behavio*r"               (behavior/behaviour plus other possible but unlikely strings)

and so on.  You can also search specific text fields such as:

summary ~ "behavio*r"

Hopefully this info will make it easier for people to find existing issues in our Jira instance as well as others around the web.

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Yes, lucene based full-text queries are very helpfull when searching in jira. As for tips on jira search there is cool add-on providing the same for full-text search in attachments. Searching with it is much easier. You can search for jira attachments content, name or type. You can try it Search Attachments for Jira

    ReplyDelete
  3. Thank you Andy,

    This saved my time :)

    ReplyDelete
  4. Hi :)

    I know that the post is old and it's a long shot, but when I try:
    text ~ "behavio*r"
    I got this error message:

    Error in the JQL Query: The character '*' is a reserved JQL character. You must enclose it in a string or use the escape '\u002a' instead. (line 1, character 17)

    How can I get around?

    Thabk you!

    ReplyDelete