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:
@@ -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']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user