hightman/xunsearch
Xunsearch PHP SDK delivers a fast full-text search engine for PHP apps, with built-in Chinese word segmentation, indexing, and query APIs. It offers simple integration, high performance, and advanced search features for Laravel or standalone PHP projects.
Architecture fit
hightman/xunsearch is a PHP client/SDK for Xunsearch, a C/C++ Chinese search engine built on Xapian and SCWS. It is not a drop-in Laravel search component and should not become the system of record. The natural fit is an external search subsystem behind an application-owned SearchService interface: Laravel domain code publishes indexable events, queued jobs write to Xunsearch through the SDK, and query code reads through an adapter with database fallback. This keeps the Laravel domain model decoupled from Xunsearch-specific APIs and preserves a future migration path to Meilisearch, Elasticsearch/OpenSearch, Typesense, or another engine.
The package is most defensible when Chinese-language full-text search is a real product requirement and when the team accepts operating a separate native daemon/index service. It is a weaker fit for teams expecting a pure-PHP, managed, or Laravel-native search package, or for products requiring advanced relevance tuning, faceting, geo search, vector search, or real-time indexing guarantees without additional engineering.
Integration feasibility
Initial integration is feasible: Composer installation, a Laravel service provider/config file, a small adapter around the SDK, Eloquent observers or domain events for indexing, queued jobs for writes, and Artisan commands for index creation/rebuild/health checks. The main unknowns are package compatibility with current PHP/Laravel versions, whether the SDK is actively maintained, and whether the Xunsearch server can be deployed cleanly in the target environment. Because the repository is marked unknown and the license is NOASSERTION, supply-chain and legal review must precede any production commitment.
Technical risk
NOASSERTION means the license cannot be assumed. Legal must confirm distribution, SaaS, modification, and attribution obligations before adoption.Key questions
Stack fit
Use the package only as an infrastructure adapter inside Laravel. Define an application-owned contract such as SearchService with methods for index, delete, search, and health. Implement XunsearchSearchService behind that contract. Keep Eloquent models and controllers free of SDK calls. Put index schema and field mappings in versioned configuration. Use queued jobs for indexing and a separate query path with timeout, circuit breaker, and database fallback.
A practical Laravel shape:
config/search.php for driver selection and Xunsearch connection settings.App\Contracts\SearchService as the stable internal API.App\Services\Search\XunsearchSearchService as the SDK adapter.App\Jobs\IndexDocument and App\Jobs\DeleteDocument for asynchronous writes.search:index, search:rebuild, search:health, and search:reconcile.Migration path
Run a proof of concept before committing. Sequence:
Avoid a big-bang migration. The old database search or existing engine should remain available until Xunsearch proves stable and relevant.
Compatibility
Verify PHP version constraints, Laravel service-provider compatibility, Composer dependency conflicts, ext-* requirements, UTF-8 handling, and Xunsearch server version compatibility. Confirm the SDK works with the target OS and deployment model (VM, container, bare metal). Validate SCWS dictionary behavior with real product vocabulary. Confirm whether the SDK uses persistent sockets, timeouts, or connection pooling, and wrap it accordingly.
Sequencing
Legal and provenance clearance should gate engineering spend. Then infrastructure, adapter, index schema, backfill, dual-write, shadow reads, canary, and cutover. Do not start with broad application integration; start with a bounded content type and a measurable search use case. If the PoC cannot demonstrate acceptable Chinese relevance and operational stability, stop and evaluate alternatives rather than deepening coupling.
Maintenance
The team must own or contract for Xunsearch daemon operations: installation, upgrades, configuration, index storage, backups, log rotation, health checks, and capacity planning. The PHP SDK is only one layer; the native search service is the durable operational burden. Pin package versions, vendor the dependency or mirror it if supply-chain risk is material, and document the exact server/SDK version pair.
Support
Assume community-only support unless a commercial arrangement exists. Stars are not a support contract. The NOASSERTION license and unknown repository mean escalation paths are unclear. Establish internal ownership for search relevance, indexing pipelines, and incident response before production.
Scaling
Scaling must be validated rather than assumed. Model index size, query throughput, write rate, rebuild duration, CPU, memory, and disk IO. Determine whether the chosen Xunsearch topology supports the required read scale, sharding, replication, or failover. Index rebuilds can be expensive; plan offline or blue/green index builds where possible. Queue-based indexing must handle backlogs during traffic spikes.
Failure modes
Ramp-up
The team needs Laravel integration work plus search-operations skills: Chinese tokenization, relevance evaluation, index lifecycle, and native daemon troubleshooting. Budget a short PoC and a hardening phase before production. A reasonable TPM stance: leverage hightman/xunsearch only as a bounded, replaceable search adapter for Chinese content, with legal clearance, a fallback path, and explicit operational ownership. Given the license ambiguity and operational footprint, do not make it a platform-wide dependency without a compelling Chinese-search use case.
How can I help you explore Laravel packages today?