Include search functionality for type search in local modules#429
Merged
nipunayf merged 4 commits intoballerina-platform:1.2.xfrom Oct 25, 2025
Merged
Include search functionality for type search in local modules#429nipunayf merged 4 commits intoballerina-platform:1.2.xfrom
nipunayf merged 4 commits intoballerina-platform:1.2.xfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds search functionality for types in local modules with a relevance-based scoring mechanism to improve search result ordering. The scoring system includes exact match, prefix match, substring match, fuzzy match, abbreviation matching, and description-based matching. Additionally, the PR updates dependency versions for HTTP and JSON data libraries, fixes primitive type handling in reference types, and includes test resources for validating the search functionality.
Key Changes
- Implemented relevance-based type search scoring for local module types
- Updated HTTP library version from 2.14.6 to 2.14.7
- Updated JSON data library version from 1.1.1 to 1.1.3
- Enhanced primitive type handling to support additional integer subtypes (Signed8/16/32, Unsigned8/16/32) and new types (byte, string:Char, regexp:RegExp)
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ReferenceType.java | Refactored primitive type handling, added support for additional int subtypes, byte, string:Char, and regexp types |
| gradle.properties | Updated stdlib versions for HTTP (2.14.7) and JSON data (1.1.3) libraries |
| Test resource files (nested/nested_editing/*) | Added test fixtures for local module type usage scenarios |
| Test resource files (search/config/types/*) | Added comprehensive search test cases covering exact match, prefix match, substring match, case insensitive, description match, special characters, and no match scenarios |
| Test resource files (embedding/model provider configs) | Fixed typo in label from "Open Model Provider" to "OpenAI Model Provider" |
| DataMapperDefinitionBuilder.java | Minor formatting cleanup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Oct 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR updates the existing submodule type search to include a relevance-based sorting mechanism. Each search result is now assigned a relevance score that determines its display order.
Since the respective types are not indexed, there is no inverted index available to calculate the search rank. As an alternative, the relevance score is computed manually to mimic the ranking behavior of SQLite FTS search.
Fixes wso2/product-ballerina-integrator#1601
Relevance Score Calculation: