# Javascript API for searching in Elasticsearch

**URL:** <https://discuss.elastic.co/t/javascript-api-for-searching-in-elasticsearch/137386>\
**Category:** Elasticsearch\
**Created:** [June 26, 2018, 8:20am UTC](https://discuss.elastic.co/t/javascript-api-for-searching-in-elasticsearch/137386 "2018-06-26T08:20:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rs123](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rs123](https://discuss.elastic.co/u/rs123)\
**Post date:** [June 26, 2018, 8:20am UTC](https://discuss.elastic.co/t/javascript-api-for-searching-in-elasticsearch/137386/1 "2018-06-26T08:20:42Z")

</div>

If I do below query in Kibana, results : `"tim is a good boy"` and I want to do same thing using js library in eclipse.

```
GET nirv/_search
{
    "query" : {
        "term" : { "user" : "tim" }
    }
}

```

I looked everywhere but did not find much of help. So can anyone provide a bit of code for a query to Elasticsearch using JS API in eclipse. What I mean is that I have a function result which provides me what elasticsearch return for particular query.

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [June 26, 2018, 10:58am UTC](https://discuss.elastic.co/t/javascript-api-for-searching-in-elasticsearch/137386/2 "2018-06-26T10:58:22Z")

</div>

Hi Radhe,

Starting new topic is not going to help I think.

> [@How to use Javascript API with eclipse?](https://discuss.elastic.co/t/how-to-use-javascript-api-with-eclipse/137273):
>
> I am new to elasticsearch ,I didn't find the way that how can i use javascript rest api with eclipse. For example if I want to search something in my elasticsearch index how to do it in eclipse with JS API?

I think the [Java scripts docs](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/quick-start.html) are pretty good. The eclipse thing is a personal matter, me personaly hate eclipse and use vim (but thats me)

I hope this helps.

---

<div class="post-metadata">

**Author:** ![rs123](https://avatars.discourse-cdn.com/v4/letter/r/73ab20/32.png) [@rs123](https://discuss.elastic.co/u/rs123)\
**Post date:** [June 26, 2018, 10:59am UTC](https://discuss.elastic.co/t/javascript-api-for-searching-in-elasticsearch/137386/3 "2018-06-26T10:59:45Z")

</div>

Thanks!

---

<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:** [July 24, 2018, 10:59am UTC](https://discuss.elastic.co/t/javascript-api-for-searching-in-elasticsearch/137386/4 "2018-07-24T10:59:54Z")

</div>

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