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

**URL:** <https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274>\
**Category:** Elasticsearch\
**Created:** [March 3, 2017, 6:40am UTC](https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274 "2017-03-03T06:40:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![amolt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amolt/32/16043_2.png) [@amolt](https://discuss.elastic.co/u/amolt)\
**Post date:** [March 3, 2017, 6:40am UTC](https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274/1 "2017-03-03T06:40:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 3, 2017, 7:19am UTC](https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274/2 "2017-03-03T07:19:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![amolt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amolt/32/16043_2.png) [@amolt](https://discuss.elastic.co/u/amolt)\
**Post date:** [March 3, 2017, 7:31am UTC](https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274/3 "2017-03-03T07:31:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 3, 2017, 7:44am UTC](https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274/4 "2017-03-03T07:44:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amolt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amolt/32/16043_2.png) [@amolt](https://discuss.elastic.co/u/amolt)\
**Post date:** [March 3, 2017, 7:54am UTC](https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274/5 "2017-03-03T07:54:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 3, 2017, 10:57am UTC](https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274/6 "2017-03-03T10:57:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amolt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amolt/32/16043_2.png) [@amolt](https://discuss.elastic.co/u/amolt)\
**Post date:** [March 3, 2017, 7:42pm UTC](https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274/7 "2017-03-03T19:42:21Z")

</div>

@dadoonet thanks...I got the point.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 31, 2017, 7:42pm UTC](https://discuss.elastic.co/t/how-do-i-add-elasticsearch-to-my-website-for-searching-documents-by-their-titles-author-name-and-issue-date/77274/8 "2017-03-31T19:42:21Z")

</div>

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