itscript / sphinxsearch-query-log-parser
SphinxSearch query log parser
Installs: 67
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
pkg:composer/itscript/sphinxsearch-query-log-parser
Requires
- php: ^5.6 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is not auto-updated.
Last update: 2025-10-06 12:41:49 UTC
README
By default parser supports formats:
[Fri Jun 29 21:17:58 2007] 0.004 sec 0.004 sec [all/0/rel 35254 (0,20)] [lj] test
[Fri Jun 29 21:20:34 2007] 0.024 sec 0.024 sec [all/0/rel 19886 (0,20) @channel_id] [lj] test
Installation
You can install directly via Composer:
$ composer require "itscript/sphinxsearch-query-log-parser":"^1.0"
Basic usage
$log_line = '[Fri Jun 29 21:17:58 2007] 0.004 sec 0.004 sec [all/0/rel 35254 (0,20)] [lj] test'; $parser = new \ITS\SphinxSearchQueryLogParser\Parser(); /** @var \ITS\SphinxSearchQueryLogParser\Log $log */ $log = $parser->parse($log_line); // it is equal to $log = (new \ITS\SphinxSearchQueryLogParser\Log()) ->setQueryDate(new \DateTimeImmutable('2007-06-29 21:17:58')) ->setRealTime(0.004) ->setWallTime(0.004) ->setMatchMode('all') ->setFiltersCount(0) ->setSortMode('rel') ->setTotalMatches(35254) ->setOffset(0) ->setLimit(20) ->setIndexName('lj') ->setQuery('test');