Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
MarcS
New Member.
479 views

Search Perspective : filter by file extension

Hi,

I would like to use the search perspective to find out the files with a specific extension, and with some specific content, across all our StarTeam projects.
I tried the following request in the search field:

+"<content to be searched for>" +name:"*.<extension>"

that failed to find the file that I found another way.

Then I tried only the following

+name:"*.<extension>"

As a result, only a small bunch of the files with that extension were found.

Could you tell me what is the correct syntax, please?

Thanks in advance,

Marc

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

RE: Search Perspective : filter by file extension

Hi Marc,
The grammar for search (syntax based on lucene indexing) may be found in the CPC documentation pp 83 to 88.
having said that, extension is just a client calculated property, it isn;t a server or search keyword.

i believe you can formulate your query as

Content: "<content to be searched for>" + Name: *.<extension>

but please don;t hold me to this, it's my interpretation of what i've just read between pages 83 to 88.

if this doesn;t work for you, i'd recommend opening an incident through MicroFocus Customer Support to get clarification.

take care
anil
0 Likes
MarcS
New Member.

RE: Search Perspective : filter by file extension

Hi Anil

I tried the syntax you proposed and saw the following error message:

"There was an error with the search service.

undefined"

 

Adding quotes after "Name:" (i.e. Content: "<content to be searched for>" + Name:"*.<extension>")removed the error but returned nothing relevant.

I will open an incident

thanks 

0 Likes
hareesh1 Absent Member.
Absent Member.

RE: Search Perspective : filter by file extension

Hi Marc,

Name:"*.<extension>" does not work because we do not support leading wildcard characters in the query.
This is because Lucene queries with leading wildcard characters (? *) can perform poorly on large indexes, so we chose not to allow it. This is documented.

Other wildcard queries are supported:
For example,

Name:Server*xml

should return files with names ServerLocale.xml
ServerMessage.xml

Name:Server*

should return files with names ServerLocale.xml
ServerMessage.xml
ServerRelease.pdf

We can add a enhancement request where Starteam Search indexes a separate field called "Extension", so you can do search queries like:

+Content:<text to search" +Extension:xml

Would that work for you?

Thanks,
Hareesh
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.