Query a Portal using PortalQueryParams with a filter containing wildcards in tags

200
3
Jump to solution
2 weeks ago
Dirk_Vandervoort
New Contributor III

I am interacting with my portal in js code. I wish to query the portal for tagged content using wildcard searches in my query filter.

Code:

 

const queryParams = new PortalQueryParams({
    filter: 'orgid:MyOrgID AND tags:"TES*"',
    num: 100        
});

portal.queryItems(queryParams).then(function(results){
    // no results are returned
    // we expect results to have tags like TEST, TESTER, TESTING, etc.
});

 

I've tried an escape character (\*) and different wildcard characters (*, %, #, etc.) with no success. 

I'm missing something obvious. Again. TIA.

0 Kudos
1 Solution

Accepted Solutions
AndreV
by
Occasional Contributor

I think filter only accepts exact values and query is the property you should go with. 

https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#que... 

gdi-hohenlohekreis.de

View solution in original post

0 Kudos
3 Replies
AndreV
by
Occasional Contributor

Did you try omitting the quotation marks around TES*?

gdi-hohenlohekreis.de
0 Kudos
Dirk_Vandervoort
New Contributor III

Without the double-quotes and using either TES\* or TES* returns all content (throttled at 100 in queryParams).

0 Kudos
AndreV
by
Occasional Contributor

I think filter only accepts exact values and query is the property you should go with. 

https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#que... 

gdi-hohenlohekreis.de
0 Kudos