Commit c61d9645 authored by Pavel's avatar Pavel
Browse files

init

parents
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+5 −0
Original line number Diff line number Diff line
.DS_Store
/composer.lock
/vendor/
/.idea/
 No newline at end of file

composer.json

0 → 100644
+37 −0
Original line number Diff line number Diff line
{
  "name": "iqdev/search-es",
  "description": "Search by elasticsearch",
  "minimum-stability": "stable",
  "license": "proprietary",
  "authors": [
    {
      "name": "Pavel Piligrimov",
      "email": "p.piligrimov@iqdev.digital"
    }
  ],
  "version": "0.0.1",
  "type": "library",
  "keywords": [
    "search",
    "elasticsearch",
    "php"
  ],
  "require": {
    "php": ">=7.4",
    "ramsey/collection": "^1.2",
    "iqdev/search-dc": "dev-main",
    "elasticsearch/elasticsearch": "^8.5",
    "vlucas/phpdotenv": "^5.4.1"
  },
  "autoload": {
    "psr-4": {
      "IQDEV\\ElasticSearch\\": "src/ElasticSearch/"
    }
  },
  "repositories": [
    {
      "type": "vcs",
      "url": "ssh://git@gitlab.iqdev.digital:8422/piligrimov/search-dc.git"
    }
  ]
}
+19 −0
Original line number Diff line number Diff line
<?php

namespace Docke\ElasticSearch\Config;

use IQDEV\ElasticSearch\Configuration;

class BaseConfiguration implements Configuration
{
    public function getIndexName(): string
    {
        return $_ENV['IQ_ES_PRODUCT_SEARCH_INDEX'];
    }

    public function getMapping(): array
    {
        return include __DIR__.'/product.mappings.php';
    }
}
 No newline at end of file
+48 −0
Original line number Diff line number Diff line
<?php

return [
    'properties' => [
        'data' => [
            'type' => 'object',
            'enabled' => false,
        ],
        'full_search_content' => [
            'type' => 'text',
        ],
        'category_id' => [
            'type'  => 'keyword',
            'index' => false,
        ],
        'search_data' => [
            'type' => 'nested',
            'properties' => [
                'keyword_facet' => [
                    'type' => 'nested',
                    'properties' => [
                        'facet_code' => [
                            'type'  => 'keyword',
                            'index' =>  true
                        ],
                        'facet_value' => [
                            'type'  => 'keyword',
                            'index' =>  true
                        ],
                    ]
                ],
                'number_facet' => [
                    'type' => 'nested',
                    'properties' => [
                        'facet_code' => [
                            'type'  => 'keyword',
                            'index' =>  true
                        ],
                        'facet_value' => [
                            'type'  => 'double'
                        ]
                    ]
                ]
            ]
        ]
    ],
];
 No newline at end of file
+11 −0
Original line number Diff line number Diff line
<?php

namespace IQDEV\ElasticSearch;

interface Configuration
{
    public function getIndexName(): string;

    public function getMapping(): array;
}
 No newline at end of file