Fix for Filter-Based API Search with Space Characters in DevPortal #12842
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
The current DevPortal API search supports multiple filter criteria, introduced in PR [1][2]. However, this update inadvertently broke the previous behavior where tags containing space characters were supported. For example, APIM 3.2.0 allowed searches like
tag:Sample APIs - New
.This PR resolves the issue by restoring support for space-containing tags in search queries. Additionally, it ensures that both
tag
andtags
filters function correctly when used with space characters.Supported Search Examples
tag:Sample APIs - New
tags:Sample APIs - New tags:pizza
Approach
The solution modifies the search logic by concatenating the following search components into the previous filter criteria:
Example Transformations
tag:Sample APIs - New name:Google
→tag:Sample APIs - New && name:Google
Google tag:Sample APIs - New
→name:Google && tag:Sample APIs - New
Google tags:Sample APIs - New tags:pizza
→name:Google && (tags:Sample APIs - New || tags:pizza)
tags:pizza
→tags:pizza
name:google tag:Sample APIs - New tag:pizza name:abc
→(name:Google || name:abc) && (tags:Sample APIs - New || tags:pizza)
[1] #12370
[2] #12466
Related issue
Issue: wso2/api-manager#3535
Internal: https://github.com/wso2-enterprise/wso2-apim-internal/issues/8509