mirror of
https://github.com/kvazar-network/crawler.git
synced 2025-01-09 22:57:55 +00:00
init config
This commit is contained in:
parent
f9288e10b0
commit
b49f81b66d
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/vendor/
|
||||
|
||||
composer.lock
|
||||
/composer.lock
|
||||
/config.json
|
16
example/config.json
Normal file
16
example/config.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"index":
|
||||
{
|
||||
"name":"kvazar",
|
||||
"host":"127.0.0.1",
|
||||
"port":9308,
|
||||
"meta":
|
||||
{
|
||||
"morphology":"stem_cz,stem_enru",
|
||||
"index_exact_words":1,
|
||||
"html_strip":1,
|
||||
"min_word_len":3,
|
||||
"min_prefix_len":3
|
||||
}
|
||||
}
|
||||
}
|
19
src/index.php
Normal file
19
src/index.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
// Load dependencies
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
// Init config
|
||||
$config = json_decode(
|
||||
file_get_contents(
|
||||
__DIR__ . '/../config.json'
|
||||
)
|
||||
);
|
||||
|
||||
// Init index
|
||||
$index = new \Kvazar\Index\Manticore(
|
||||
(string) $config->index->name,
|
||||
(array) $config->index->meta,
|
||||
(string) $config->index->host,
|
||||
(int) $config->index->port
|
||||
);
|
Loading…
Reference in New Issue
Block a user