Skip to content

Internal Search Index

anlausch edited this page Oct 23, 2018 · 2 revisions

For efficient and effective internal search, LOC-DB employs Elasticsearch [1] as an internal search index. For synchronizing the MongoDB database with the search engine, we use the node.js module mongoosastic[2], which extends the ordinary mongoose[3] functionality.

The initial configuration takes place in ./api/models/bibliographicResource.js:

brSchema.plugin(mongoosastic,{
    index: config.DB.SCHEMA + '_br',
    host: config.SEARCHINDEX.HOST,
    port: config.SEARCHINDEX.PORT,
    protocol: config.SEARCHINDEX.PROTOCOL
});

As usual, configuration values can be set by providing default values or setting the respective environment variables accordingly.

[1] https://www.elastic.co/products/elasticsearch

[2] https://github.com/mongoosastic/mongoosastic

[3] https://mongoosejs.com/

Clone this wiki locally