Add competitor-discovery search (/discover)

The actual "who sells honey with a .es domain" feature: search sites
by keyword — matched against page title/description/keywords/body
text via a new MySQL fulltext index on site_pages — combined with an
optional TLD filter on the domain. Results are sites ranked by number
of matching pages. Shows nothing until a filter is entered, so it
doesn't just duplicate the plain Sites browse page.

Verified against real .es data pulled in for the test (dominio ->
4 matching sites, correctly ranked and TLD-filtered).
This commit is contained in:
m105
2026-07-22 21:22:14 +03:00
parent f15eb5aec1
commit cefb846a19
5 changed files with 167 additions and 1 deletions
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Backs the product/keyword search used by the discovery page — matching a term
* like "honey" against a page's title/description/keywords/body text.
*/
public function up(): void
{
Schema::table('site_pages', function (Blueprint $table) {
$table->fullText(['title', 'description', 'keywords', 'content']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('site_pages', function (Blueprint $table) {
$table->dropFullText(['title', 'description', 'keywords', 'content']);
});
}
};