The K-Search is the interface of the search component for the K-Link project. It consists of a set of APIs that enable third party clients to:
- send data to be analyzed by the K-Search internal engine and
- perform a full-text search over such data.
K-Search can be installed on most operating systems. The setup is heavily based on Docker.
- Check the system requirements.
- Use an operating system supported by Docker (we use Debian in production)
- Make sure you have installed the latest version of Docker and Docker Compose.
These few commands allow you to quickly install a K-Search locally on your computer for testing purposes.
- Create a directory:
mkdir k-search && cd k-search
- Download configuration file:
curl -o docker-compose.yml https://raw.githubusercontent.com/k-box/k-search/develop/docker-compose.yml.dist
- Start up services:
docker-compose up -d
(when running this for the first time, it will download a lot of data and take a while) - Visit your K-Search: http://localhost:8080/docs (no login is required in the default setup).
The general documentation is located under the docs
folder.
Here is a brief table of contents for the most important parts:
The K-Search is implemented in PHP (v7.1.x) by using the Symfony framework. The project structure follows the latest Symfony (v4.x) recommendation, as available at Symfony Architecture page.
This project uses Drifter to provide a replicable development environment, where most of the needed configurations and external services are installed and configured.
The only requirement is a working installation of Vagrant. Drifter supports both VirtualBox and the LXC containers, choose the one that best suits your needs. Refer to the Drifter documentation for further details about its requirements and configuration.
To create working instance of a VM for the K-Search development and testing run the following commands:
- Obtain the K-Search code:
git clone https://github.com/k-box/k-search.git --recursive
- Start the VM and let Drifter provision it:
vagrant up
The K-Search VM will be available at http://ksearch.test
.
The K-Search uses a set of Open Source technologies to support the full-text search and data handling/manipulation functionality:
- K-Search Engine, based on Apache Solr: Search engine for data indexing and searching;
- Apache Tika: Text and metadata extraction from multiple file formats, bundled with Solr.
Contributions to the K-Search API are accepted by opening a Pull Request on the project page on GitHub.
- the code must conform to the Symfony Coding Standards;
- the code must be covered by tests (
PHPUnit
, ...); - a changelog is provided with a summary of the changes.
The K-Search API code is regularly checked with the following tools:
php-cs-fixer
: to comply to the Symfony Coding Standards and additional PSRs (see: http://cs.sensiolabs.org)phpstan
: Static analysis checks for PHP with a check-level of7
(see: https://github.com/phpstan/phpstan)phpunit
: PHP testing framework (see: https://phpunit.de/)
This project is licensed under the AGPL v3 license, see LICENSE.txt.