|
|
@ -1,18 +1,21 @@ |
|
|
|
# Search and Displace Core |
|
|
|
# Search and Displace Core |
|
|
|
|
|
|
|
--- |
|
|
|
**NOTE** |
|
|
|
|
|
|
|
The installation steps below were tested on an Ubuntu machine and should be adapted for each specific environment. |
|
|
|
|
|
|
|
--- |
|
|
|
|
|
|
|
## Install |
|
|
|
- Create the `.env` file by copying the contents from the `.env.example` file. |
|
|
|
|
|
|
|
`cp .env.example .env` |
|
|
|
|
|
|
|
- Generate the app key by running the following command: |
|
|
|
|
|
|
|
`php artisan key:generate` |
|
|
|
|
|
|
|
- Install the 'sqlite' driver for your PHP version if it is not already installed. |
|
|
|
|
|
|
|
- For the 'QUEUE_CONNECTION' variable in `.env` you can use either `sync` or `redis` (recommended). If you choose to use `redis` |
|
|
|
then you need to make sure that it is installed on your machine. |
|
|
|
- For the 'QUEUE_CONNECTION' variable in `.env` you can use either `sync` or `redis` (recommended). If you choose to use `redis` |
|
|
|
then you need to make sure that it is installed on your machine. |
|
|
|
|
|
|
|
`apt update` |
|
|
|
|
|
|
@ -20,16 +23,20 @@ then you need to make sure that it is installed on your machine. |
|
|
|
|
|
|
|
- Install the `Search and Displace Ingest` app, found here https://git.law/newroco/searchanddisplace-ingest |
|
|
|
- Get the URL of the `Search and Displace Ingest` app and add it to the `SD_INGEST_URL` variable in `.env` |
|
|
|
- Add in `.env` the `WEBHOOK_CLIENT_SECRET` value which needs to be the same value as the `WEBHOOK_CORE_SECRET` in |
|
|
|
- Add in `.env` the `WEBHOOK_CLIENT_SECRET` value which needs to be the same value as the `WEBHOOK_CORE_SECRET` in |
|
|
|
the `Search and Displace Ingest` app `.env` file |
|
|
|
- Add in `.env` the `SD_DUCKLING_URL` value which by default is `http://0.0.0.0:8000/parse`. You can find |
|
|
|
details about installing Facebook Duckling in a section below. |
|
|
|
- Add in `.env` the `SD_DUCKLING_URL` value which by default is `http://0.0.0.0:8000/parse`. You can find |
|
|
|
details about installing Facebook Duckling in a section below. |
|
|
|
|
|
|
|
- Install composer |
|
|
|
- Install composer |
|
|
|
- Install composer dependencies |
|
|
|
|
|
|
|
`composer install` |
|
|
|
|
|
|
|
- Generate the app key by running the following command: |
|
|
|
|
|
|
|
`php artisan key:generate` |
|
|
|
|
|
|
|
- Install NodeJS and npm |
|
|
|
- Install npm dependencies |
|
|
|
|
|
|
@ -43,12 +50,12 @@ details about installing Facebook Duckling in a section below. |
|
|
|
|
|
|
|
- `php artisan migrate` |
|
|
|
|
|
|
|
### Facebook Duckling |
|
|
|
### Facebook Duckling |
|
|
|
- `$ apt-get install libpcre3-dev` |
|
|
|
- `$ cd ..` |
|
|
|
- `$ cd ..` |
|
|
|
- `$ git clone https://github.com/facebook/duckling.git && cd duckling` |
|
|
|
- `$ curl -sSL https://get.haskellstack.org/ | sh` |
|
|
|
- `$ stack build && stack exec duckling-example-exe` |
|
|
|
- `$ curl -sSL https://get.haskellstack.org/ | sh` |
|
|
|
- `$ stack build && stack exec duckling-example-exe` |
|
|
|
- `$ stack test` |
|
|
|
|
|
|
|
### Converting documents from MD to ODT |
|
|
@ -88,17 +95,17 @@ have 4 digits, a dash, 3 digits, a dash, and finally 3 digits; 1234-123-123 is a |
|
|
|
## Compounded searcher |
|
|
|
A compounded searcher contains one or more searchers, which can be either basic or comopounded. |
|
|
|
|
|
|
|
The searchers can be listed in two ways: in rows and in columns. Each column in a row |
|
|
|
The searchers can be listed in two ways: in rows and in columns. Each column in a row |
|
|
|
extends the searching criteria and each row filters the results of the previous row. |
|
|
|
|
|
|
|
Let's take as an example the following searcher: the first row has 2 searchers, in the first column |
|
|
|
Let's take as an example the following searcher: the first row has 2 searchers, in the first column |
|
|
|
we have the 'Email' native basic searcher and in the second column we have a custom basic searcher |
|
|
|
which searches for text strings that have a leading '#' character. The second rows has only one column |
|
|
|
and that column has a custom basic searcher which searches for text strings which contain the '@' character. |
|
|
|
After we execute the Search&Displace the first row of the searcher will be applied on the initial document content |
|
|
|
and will find all email addresses and all text strings which have a leading '#' character, so the operation applies |
|
|
|
and will find all email addresses and all text strings which have a leading '#' character, so the operation applies |
|
|
|
the searchers in the first row independently, each column extending the searching criteria. |
|
|
|
Then the second row will be applied on the results of the first row, so on the email addresses and the text strings |
|
|
|
Then the second row will be applied on the results of the first row, so on the email addresses and the text strings |
|
|
|
which have a leading '#' character, basically each row filters the results of the previous row. |
|
|
|
|
|
|
|
# Demo Version |
|
|
|