Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork108
Add methods, properties, constants as directly searchable items in API docs#1183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Draft
Copilot wants to merge2 commits intomasterChoose a base branch fromcopilot/fix-8c51734d-c46e-4b57-a5ad-a37f477b4f58
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
+113 −100
Conversation
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
Co-authored-by: samdark <47294+samdark@users.noreply.github.com>
CopilotAI changed the title[WIP] @yiisoft-contrib/yiiframework.com/issues/232Add methods, properties, constants as directly searchable items in API docsJul 29, 2025
Copilot finished work on behalf ofsamdarkJuly 29, 2025 11:14
Sign up for freeto 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.
Uh oh!
There was an error while loading.Please reload this page.
This PR implements the feature requested in issue#232 to make API documentation methods, properties, and constants directly searchable, providing users with immediate links to specific API elements instead of just their containing classes.
Problem
Previously, when searching for specific methods like "refresh()", users would only see the containing class (e.g.,
ActiveRecord) in search results and had to manually navigate into the class documentation to find the specific method. This created an extra step and made the search experience less efficient.Solution
The implementation reactivates existing
SearchApiPrimitiveinfrastructure that was commented out in the codebase. TheSearchApiPrimitivemodel was already present but disabled - this PR enables it with necessary updates for modern usage.Key Changes
Enabled primitive indexing in
SearchApiType::createRecord()by uncommenting and updating the code to handle array-based API data fromtypes.jsonUpdated
SearchApiPrimitive::createRecord()to work with the JSON array format used by Yii 2.0+ API documentation instead of the original object-based approachImplemented missing methods
getDescription()andgetType()in theSearchApiPrimitiveclassModernized Elasticsearch mappings by replacing deprecated
not_analyzedwithkeywordsyntaxRe-enabled primitive search in both regular search and search-as-you-type functionality
Enhanced search result display to show primitives in "ClassName::methodName()" format with proper type indicators
Visual Improvement
The screenshot demonstrates the improvement: instead of showing only the
ActiveRecordclass when searching for "refresh()", users now get direct links toActiveRecord::refresh()method along with the class itself.Examples
Searching for "refresh()":
Searching for "EVENT_BEFORE_INSERT":
Searching for "tableName":
Compatibility
The feature will work immediately for API documentation that includes method, property, and constant information in the
types.jsonformat used by Yii 2.0+.Fixes#232
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
asset-packagist.org/usr/bin/php8.3 -n -c /tmp/geSmrl /usr/bin/composer update --no-interaction(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.