Summary / 概要
Add a boolean filter on endangered status (is_endangered) to the Algolia search.
Algolia 検索に危機遺産 (is_endangered) による boolean フィルタを追加する。
Why / 背景
The "List of World Heritage in Danger" is a recurring topic on the certification exam. The is_endangered column already propagates up to the DTO, but is not exposed as a search filter axis. The "skim through endangered heritage during my commute" study flow is therefore unavailable today.
検定では「危機遺産リストに登録されているもの」というジャンルが定番。現状 is_endangered カラムは DTO まで伝播しているが、検索の絞り込み軸として露出していない。「危機遺産だけ通勤中にざっと眺める」という学習動線が無い。
Changes / 対応内容
Application layer
Domain / Infrastructure
Presentation
Tests
Acceptance / 受け入れ条件
is_endangered=true returns endangered heritage only; false returns non-endangered heritage only; unspecified returns all records as before.
- An invalid value (e.g.
is_endangered=foo) returns HTTP 400.
is_endangered=true で危機遺産のみ、false で非危機遺産のみ、未指定で従来通り全件。
- 不正値(例:
is_endangered=foo)は 400。
Summary / 概要
Add a boolean filter on endangered status (
is_endangered) to the Algolia search.Algolia 検索に危機遺産 (
is_endangered) による boolean フィルタを追加する。Why / 背景
The "List of World Heritage in Danger" is a recurring topic on the certification exam. The
is_endangeredcolumn already propagates up to the DTO, but is not exposed as a search filter axis. The "skim through endangered heritage during my commute" study flow is therefore unavailable today.検定では「危機遺産リストに登録されているもの」というジャンルが定番。現状
is_endangeredカラムは DTO まで伝播しているが、検索の絞り込み軸として露出していない。「危機遺産だけ通勤中にざっと眺める」という学習動線が無い。Changes / 対応内容
Application layer
public readonly ?bool $isEndangeredtoAlgoliaSearchListQuery(null= unspecified,true= endangered only,false= non-endangered only).AlgoliaSearchListQueryにpublic readonly ?bool $isEndangeredを追加(null= 指定なし、true= 危機遺産のみ、false= 危機遺産以外のみ)。?bool $isEndangeredargument toAlgoliaSearchListQueryFactory::build().AlgoliaSearchListQueryFactory::build()に?bool $isEndangered引数を追加。Domain / Infrastructure
WorldHeritageSearchPortimplementation'ssearch(), whenisEndangered !== null, appendis_endangered:true|falsetofacetFilters.WorldHeritageSearchPort実装のsearch()でisEndangered !== nullのときfacetFiltersにis_endangered:true|falseを付与。is_endangeredto theattributesForFacetingof the Algolia index settings.Algolia インデックス設定の
attributesForFacetingにis_endangeredを追加。Presentation
is_endangeredquery parameter in the search endpoint Controller / FormRequest. Validation:boolean; null when unspecified.Search エンドポイントの Controller / FormRequest で
is_endangeredクエリパラメータを受ける(バリデーション:boolean、未指定時は null)。Tests
AlgoliaSearchListQueryFactoryTest:true/false/nullare stored correctly on the DTO across the three cases.AlgoliaSearchListQueryFactoryTest:true/false/nullの 3 パターンが DTO に正しく入る。facetFiltersis built as expected for each value.Search Port の単体テスト: 各値で facetFilters の組まれ方が期待通り。
GET /api/search?is_endangered=truereturns endangered heritage only.Feature:
GET /api/search?is_endangered=trueで危機遺産のみ返る。Acceptance / 受け入れ条件
is_endangered=truereturns endangered heritage only;falsereturns non-endangered heritage only; unspecified returns all records as before.is_endangered=foo) returns HTTP 400.is_endangered=trueで危機遺産のみ、falseで非危機遺産のみ、未指定で従来通り全件。is_endangered=foo)は 400。