How do I add Elasticsearch to my website for searching documents by their titles,author name and issue date?

Hello everyone,
I am working on a project called University Repository. In this project users upload the document in .pdf .ppt format and the document gets stored in Mongodb. I am able to display all files present in DB to webpage. Now, for the next part I want to add ES search box to my website. How do I do that. Any guidance will really be appreciated. Thanks.

PS: I am using HTML/CSS, JavaScript for frontend and PHP,MongoDB for backend.

You need to create a JSON document which contains the title, author, date and send it to elasticsearch.

If you want to be able to search for the content, you can provide the binary file as a BASE64 field and use ingest-attachment plugin to extract content and other metadata.

You can also use FSCrawler project with its new REST service and upload your file to FSCrawler which will generate a JSON and send it to elasticsearch.

but my files are already stored in DB.I want to search those files.

If you don't send anything to elasticsearch you won't be able to use elasticsearch for searching.

so my question is how do I sync files between MongoDB and ES. Its the same as sending data to ES I guess. @dadoonet

I'd send content to both systems at the same time.

@dadoonet thanks...I got the point.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.