Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 intomaster
base:master
Choose a base branch
Loading
fromcopilot/fix-8c51734d-c46e-4b57-a5ad-a37f477b4f58

Conversation

Copy link
Contributor

CopilotAI commentedJul 29, 2025
edited
Loading

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 existingSearchApiPrimitive infrastructure that was commented out in the codebase. TheSearchApiPrimitive model was already present but disabled - this PR enables it with necessary updates for modern usage.

Key Changes

  1. Enabled primitive indexing inSearchApiType::createRecord() by uncommenting and updating the code to handle array-based API data fromtypes.json

  2. UpdatedSearchApiPrimitive::createRecord() to work with the JSON array format used by Yii 2.0+ API documentation instead of the original object-based approach

  3. Implemented missing methodsgetDescription() andgetType() in theSearchApiPrimitive class

  4. Modernized Elasticsearch mappings by replacing deprecatednot_analyzed withkeyword syntax

  5. Re-enabled primitive search in both regular search and search-as-you-type functionality

  6. Enhanced search result display to show primitives in "ClassName::methodName()" format with proper type indicators

Visual Improvement

SearchApiPrimitive Feature Demo

The screenshot demonstrates the improvement: instead of showing only theActiveRecord class when searching for "refresh()", users now get direct links toActiveRecord::refresh() method along with the class itself.

Examples

Searching for "refresh()":

  • Before: Shows "ActiveRecord" class only
  • After: Shows "ActiveRecord::refresh()" method + class

Searching for "EVENT_BEFORE_INSERT":

  • Direct link to "ActiveRecord::EVENT_BEFORE_INSERT" constant

Searching for "tableName":

  • Direct link to "ActiveRecord::tableName" property

Compatibility

  • Backward compatible: Works with existing Yii 1.0 data (no primitives available)
  • Forward compatible: Automatically activates for Yii 2.0+ when detailed API data is available
  • No breaking changes: Existing search functionality remains unchanged

The feature will work immediately for API documentation that includes method, property, and constant information in thetypes.json format 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
    • Triggering command:/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.

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
CopilotAI requested a review fromsamdarkJuly 29, 2025 11:14
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

Reviewers

@samdarksamdarkAwaiting requested review from samdark

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Search: Add methods, properties, constants as directly searchable items

2 participants

@samdark

[8]ページ先頭

©2009-2025 Movatter.jp