A simple search engine demonstrating full-text search capabilities of Elasticsearch.
App supports configuration by using environment variables:
PAGE_SIZE
[int] - max number of records per page (defaults to5
)ES_INDEX
[str] - name of index (or index alias) used in search (defaults tonews
)ES_QUERY_TEMPLATE
[str] - name of search query template used in search (defaults tobrryle
)
Any Elasticsearch index that will be used with Brylle
needs to contain following properties:
title
- title of the documentdescription
- description of the documentcategory
- main category of the documentsubcategory
- subcategory for the documenturl
- url of the original documentlabels
- string containing labels relevant to document (doesn't need to be an array)labelsSplit
- optional array of labels to display under the description of the document
Any query template that will be used with Brylle
needs to accept 3 parameters:
pQuery
- query stringpFrom
- index of page to start displaying results from (mapping tofrom
property of Elasticsearch query)pSize
- max size of single page of data (mapping tosize
property of Elasticsearch query)
- Run
node server.js
to start server - Run
npm run-script build
to overwrite served content
- Instantiate installation using docker
docker-compose up -d
- Setup sample Elasticsearch objects
make dummy-setup
It will register:
- Dummy data containing 500 documents (loaded into
news-dummy
index) - Index alias pointing
news
tonews-dummy
- Search query template named
brryle