Work Item Query - Contains Substring

Description
mircea
Posts: 5
Joined: Fri Feb 21, 2014 2:45 pm

Work Item Query - Contains Substring

Postby mircea » Tue Sep 25, 2018 8:00 am

Hi,
I am struggling with creating a query that searches for items that contain a certain substring in a field (ex: title). The titles of Work Items look like this:

3DCADSP_VETP_seno1sp2_r1_Ex1
CADS_VETP_seno1sp2_r3_Ex1
PT_VETP_seno1sp3_r1_Ex1
IOD_VETP_seno1sp3_r3_Ex2

I am looking for a query that would only return items that contain "seno1sp3_r3", so in the above example only IOD_VETP_seno1sp3_r3_Ex2 would be returned. Any ideas?

Thanks,
Mircea

mhoe
Posts: 25
Joined: Tue Nov 29, 2016 3:30 pm

Re: Work Item Query - Contains Substring

Postby mhoe » Tue Sep 25, 2018 8:31 am

In general you can use Wildcards like ? and * inside your lucene query.
Unfortunately you cannot use this wildcards as the first character of a search.
If there were any whitespaces before your search string "senso1sp3_r3" you could have used that.

mircea
Posts: 5
Joined: Fri Feb 21, 2014 2:45 pm

Re: Work Item Query - Contains Substring

Postby mircea » Tue Sep 25, 2018 9:54 am

Hey, thanks for the reply. Yes, I noticed I can't use wildcards at the beginning of the query. I also tried using RegExp for this but I can't figure it out. The documentation says it can be used while enclosed in forward slashes so I tried

Code: Select all

title:/.*seno1sp3_r3.*/
but it doesn't return anything.

The RegEx query .*seno1sp3_r3.* should be correct though...

Jürgen
Posts: 44
Joined: Tue Sep 12, 2017 1:02 pm

Re: Work Item Query - Contains Substring

Postby Jürgen » Mon Oct 01, 2018 2:46 pm

Unfortunately also this regular expression uses a wildcard at the beginning of the word, and this is not supported in Polarion.

Polarion builds an index of words which it then uses for searching. It is possible to influence this lexicon by setting the parameter search.wordBoundaries in the configuration (search for it in the help).

Here for example you can tell Polarion which signs are used to define the end of the word. Per default an underscore is part of one word, so you cannot find your expressions. If underscores would be defined as boundaries, you could search for any part of your strange titles.

Be careful though: this is a global setting and will influence all searches. Especially wildcards might behave different. In your examples it might then be not possible to search for 3DCADSP_VETP*, because this is then two words, and only the second one is wildcarded.

We tried this parameter setting it so "standard", with the result, that for searching a work item with id, you have to write "ABC-123". Only writing ABC-123 (without the "") did not find it any longer.


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: No registered users and 5 guests