2025年9月13日土曜日

Apache Solr を利用して キーワード検索や自然言語検索Tips

 

✅ 心得(やるべきこと)

1. スキーマ設計

  • テキストフィールドは用途別に分ける
    タイトル、本文、タグ、メタ情報などは別フィールドにして検索・ブーストを調整可能にする。

  • トークナイザー/アナライザーの適切な選択

    • 英語:StandardTokenizerFactory + LowerCaseFilterFactory + StopFilterFactory

    • 日本語:KuromojiTokenizerFactory で形態素解析を利用

  • 同義語辞書を活用
    SynonymFilterFactory で「ノートPC = ラップトップ」などを正規化。


2. クエリ設計

  • 複数クエリパーサーを使い分ける

    • キーワード一致:edismax

    • フレーズ検索:phrase

    • ファセットや絞り込み:fq

  • 検索ブースティング

    • タイトル > 本文 > タグのように重み付けを設定

    • 新しい記事や人気記事を boost パラメータで優遇する


3. ユーザー体験向上

  • サジェスト/オートコンプリート
    SuggesterTermsComponent を利用して入力補助。

  • スペルチェック/曖昧検索
    SpellCheckComponentFuzzyQuery (~演算子) でユーザー誤入力を吸収。

  • ハイライト機能
    検索ヒット箇所を強調表示して UX 改善。


4. 運用・パフォーマンス

  • キャッシュ活用
    Filter Cache / Query Result Cache を調整し、再利用性の高いクエリを高速化。

  • インデックス最適化
    大量更新の後は optimize よりも softCommitautoCommit を推奨。

  • スケール設計
    大規模用途では SolrCloud を採用してシャーディングとレプリケーションを組み合わせる。


❌ べからず(避けるべきこと)

1. スキーマ関連

  • 全フィールドを text_general にまとめる
    → ブースト調整不能・パフォーマンス劣化の原因。

  • ストップワードや形態素解析を無視
    → 「の」「は」などが検索に残ると精度低下。


2. クエリ関連

  • q=*:* を乱用
    → 全件検索は重い。必ず fq と組み合わせて制限する。

  • ユーザー入力をそのまま Solr に投げる
    → 不要なワイルドカードや構文エラーで負荷・脆弱性増大。

  • クエリパーサーを1種類に固定
    → 複雑なニーズ(曖昧検索、ファセット、範囲検索)に対応できない。


3. ユーザー体験

  • サジェストやスペル補正なしで自然文検索を実装
    → 「今日の天気」「きょの天気」などで結果ゼロになる。

  • ハイライトなし
    → ユーザーが検索結果の「どこにヒットしたか」分からない。


4. 運用

  • インデックスを無計画に再構築
    → サービス停止・性能劣化。更新戦略(近リアルタイム検索 NRT)を設計すること。

  • SolrCloud 導入時に ZooKeeper の冗長化をしない
    → シングルポイント障害になる。

  • キャッシュ設定をデフォルト放置
    → クエリごとの特性に応じた調整が必須。


🔑 まとめ

How to Install Windows 11 on an Unsupported PC (Step-by-Step Guide)

 

Thinking about upgrading to Windows 11 but your PC doesn’t meet Microsoft’s official requirements? You’re not alone — and yes, it is still possible. Whether your machine fails the CPU check or your TPM version isn’t the latest, there are two reliable workarounds: a simple registry tweak or using the free Rufus tool to create modified install media.

Below, I’ll walk you through both options. Choose the one that works best for your situation.


 Before You Begin: A Quick Note

Both methods below let you bypass CPU and TPM checks — but there are some caveats:

  • You must run the Setup from within Windows (not by booting from a USB).

  • Secure Boot and any TPM version are still required for the registry method.

  • These methods are not officially supported by Microsoft, so proceed at your own risk.

  • Always back up your data before making changes to the registry or reinstalling Windows.


Option 1: Use a Registry Edit to Bypass CPU/TPM Checks

If you’re already running Windows 10 or 11, you can apply a quick registry edit and run the installer from within Windows. Here’s how.

Step 1: Edit the Registry

  1. Press Win + R, type regedit, and press Enter.

  2. Navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\Setup\MoSetup
  1. If the MoSetup key doesn’t exist, right-click the Setup folder > New > Key, name it MoSetup.

  2. Inside MoSetup, right-click on the right panel > New > DWORD (32-bit) Value.

  3. Name the value:

AllowUpgradesWithUnsupportedTPMOrCPU
  1. Double-click it, set the Value data to 1, and click OK.

  2. Close Registry Editor and restart your PC.

Pro Tip: Double-check spelling — even a small mistake can prevent the upgrade from working.


Step 2: Download the Windows 11 ISO

  1. Go to aka.ms/DownloadWindows11.

  2. Scroll down to Download Windows 11 Disk Image (ISO).

  3. Choose your edition and language (see note below), then click Download.

Language Tip: If your system uses English (UK), make sure to select English International to avoid losing apps and files during upgrade.


 Step 3: Mount the ISO

  • After downloading, right-click the ISO file > Mount.

  • It will appear as a new virtual DVD drive in File Explorer.


Step 4: Run Setup

  • Open the mounted drive and double-click Setup.exe.

  • You’ll get a warning about system requirements. Click Accept.

  • Choose what to keep:

    • Keep everything (apps, files, settings)

    • Keep data only

    • Clean install

Let the upgrade run. Most users report smooth installations using this method.


 Option 2: Use Rufus to Create a Bootable USB Without Restrictions

If your PC doesn’t support Secure Boot, UEFI, or you want a clean install, Rufus is your best bet. This free tool lets you create a Windows 11 USB installer that skips compatibility checks automatically.

What You’ll Need

  • A USB drive (16 GB or larger) — this will be erased.

  • The Windows 11 ISO file (download it as shown in Option 1).

  • Rufus version 4.6 or newer (older versions won’t work as of 24H2).

Note: Rufus won’t help if your CPU lacks SSE4.2 and PopCnt — these are required in Windows 11 24H2 and later. PCs that old probably aren’t worth upgrading anyway.


 Step-by-Step with Rufus

  1. Download Rufus (either from the dev site or Microsoft Store).

  2. Plug in your USB drive.

  3. Launch Rufus:

    • Select your USB drive.

    • Under Boot selection, choose Disk or ISO image.

    • Click Select and open your Windows 11 ISO.

  4. Click Start.

  5. A pop-up will appear: Windows User Experience.

    • Check the box: Remove requirement for 4GB+ RAM, Secure Boot, and TPM 2.0.

    • You can also tweak other settings here.

  6. Click OK, then Start to create the bootable USB.


 Install Windows 11

  1. Once the USB is ready, open it in File Explorer.

  2. Don’t boot from it — instead, double-click Setup.exe from within Windows.

  3. Accept the compatibility warning and continue.

Reminder: You must run Setup from within your current Windows install. Booting from USB will cause errors on unsupported hardware.


Did It Work for You?

If you followed either method and successfully upgraded your PC, let me know how it went in the comments!

Ran into issues? Feel free to share:

  • Your PC’s make and model

  • Which method you used

  • Screenshots of any errors

I'm happy to help troubleshoot or point you in the right direction.


Final Thoughts

Microsoft may not officially support older PCs, but that doesn’t mean you’re out of luck. With just a little technical know-how, Windows 11 is still within reach — even on hardware Microsoft says is “unsupported.”

This guide was last updated September 12, 2025, with the latest info on the Windows 11 24H2 release and new Rufus options.