Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add search endpoint logic. #141

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Add search endpoint logic. #141

wants to merge 10 commits into from

Conversation

yu23ki14
Copy link
Collaborator

@yu23ki14 yu23ki14 commented Jan 26, 2025

NoteとPostを統合的に検索する /api/v1/data/search を実装。

変更点

  • APIディレクトリにエンドポイントルートを追加

@router.get("/search", description=V1DataSearchDocs.description, response_model=SearchResponse)

  • Commonディレクトリに実際の検索ロジックと、Paginationのためのカウントロジックを追加

def search_notes_with_posts(

def count_search_results(

テストコードは ./tests/test_search.py に記述

メモ

  • デプロイ環境でテストするために、productionの時にcommonのブランチをfeature/138にしているので、マージする前に変更する必要がある。

@yu23ki14 yu23ki14 requested a review from osoken January 27, 2025 00:05
@@ -61,7 +61,7 @@ dev=[
"httpx",
]
prod=[
"birdxplorer_common @ git+https://github.com/codeforjapan/BirdXplorer.git@main#subdirectory=common",
"birdxplorer_common @ git+https://github.com/codeforjapan/BirdXplorer.git@feature/138#subdirectory=common",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここはもとに戻してからマージですね。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

このコメントアウトは意図通りですか?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

search_notes_with_postscount_search_results のフィルタを適用する部分は private 関数に切り出してまとめてもいいかもしれません。(他のところにもありますので、一気にまとめたくなるかもしれませんが、一旦これだけやる想定です)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants