Browse Source

init config

main
ghost 10 months ago
parent
commit
b49f81b66d
  1. 3
      .gitignore
  2. 16
      example/config.json
  3. 19
      src/index.php

3
.gitignore vendored

@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
/vendor/
composer.lock
/composer.lock
/config.json

16
example/config.json

@ -0,0 +1,16 @@ @@ -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

@ -0,0 +1,19 @@ @@ -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…
Cancel
Save