Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Help using proximity search

According to the documentation, I can do a proximity search to find words within a certain distance of each other. The example is simply

"atlassian jira"~10
I'm assuming that I can use a field in conjunction, but when I try this:
summary ~ "html5 credit card"~2
I get an error: Error in the JQL Query: Expecting either 'OR' or 'AND' but got '~'. (line 1, character 30)
Can someone please explain how to correctly do this kind of search?

1 answer

The thing to note is the second term needs to a string, so the whole expression should be quoted. One of the confusing things is there quoting for the search expression and then there is quoting for the JQL. The outer quote is for the search expression. The tilde in the string is interpreted by JQL.

project = ANSWERS AND summary ~ '"emails event"~5'

Well, it's not giving me any errors, but it also isn't returning anything. Maybe I don't understand how it's supposed to work. Example: I have a ticket with this in the summary - "Actual Behavior: Crazy Cheese pizza is no longer available, however, if a user places an order from their Favorite Items and the pizza = crazy cheese pizza, then the order gets placed for a pizza type no longer available."

I would have thought that the search

summary ~ '"Crazy pizza"~25'

would return that ticket. But it's not. Can you clarify?

For the expression to be true all the "pizza" words must be within 25 words of the word "Crazy". So, if I counted correctly, last "pizza" word is 32 words from the first "crazy" word. My counting might be off by one, but it does change the result.

You might be looking for

summary ~ crazy AND summary ~ pizza

I tried your example on jira.atlassian.com using the DEMO project and it worked fine. I was thinking it was an and condition, but it looks like an OR condition.

project = DEMO and summary ~ '"Crazy pizza"~25'

I don't know what to tell you. I tried changing the number to 40 so that it would encompass the 32 word distance you mention two comments up, and it didn't work. I tried adding a project into the query, and it still doesn't work. It's not giving the error anymore, but it's not returning any results. Is there some kind of configuration that needs to be done to allow this type of searching?

Hmmm.... What is your version of your Jira system? Can you try it on jira.atlassian.comin the demo project? The issue I created was DEMO-2865.

We're on 5.2. But per the documentation I linked in the OP, proximity search is supported.

There was some JQL behavioral changes, but I do not remember which version it occured in. I would try a simplier case (no repeating words) and see if you can make it work. I still recommend trying the search out on jira.atlassian.com, so you know for sure that it does work.

Hello Norman,

The single quote find was great. I had it resolve an issue with a proximity search invalid JQL syntax . I was curious how you came across the info?

Thanks,

Ramiro Castro

sin8 I'm New Here Mar 02, 2021

Hello,

Is there any new information how to use the proximity search?
I'm having the same problem with confluence server.
cql=(title~'"document title"~3')
doesn't find the document with the title.

Confluence 7.11.0

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you