# New to ElasticSearch

**URL:** <https://discuss.elastic.co/t/new-to-elasticsearch/4002>\
**Category:** Elasticsearch\
**Created:** [March 1, 2011, 4:04pm UTC](https://discuss.elastic.co/t/new-to-elasticsearch/4002 "2011-03-01T16:04:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![K\_B](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@K\_B](https://discuss.elastic.co/u/K_B)\
**Post date:** [March 1, 2011, 4:04pm UTC](https://discuss.elastic.co/t/new-to-elasticsearch/4002/1 "2011-03-01T16:04:30Z")

</div>

Hello Group,  
Hello Shay,

i'm currently looking for an alternative to SOLR, as SOLRs java api  
SOLRJ is more a mess than useful. As a typical newbie, I got a few  
questions that I couldn't answer myself by looking at the doc's.

1. Does ElasticSearch offer Faceting?  
I looked at Query DSL doc but didn't see any faceting there;

2. How can I implement tree structures with ES?  
in SOLR, one can use a multi-valued field and insert there precompiled  
tree-structures like this:  
0\_Root  
1\_Root\_Foo  
1\_Root\_Foo2  
2\_Root\_Foo\_Bar  
2\_Root\_Foo\_Bar2  
and then facet over e.g. "1\_Root\_Foo" - does this work in ES, too?

3. I prefer to have the search solution sitting next to the webapp in  
the same server - is there any way one can deploy ElasticSearch as a  
war in an JEE Server like Glassfish 3?

Best,

K.B.

---

<div class="post-metadata">

**Author:** ![Administrator\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/administrator_2/32/3211_2.png) [@Administrator\_2](https://discuss.elastic.co/u/Administrator_2)\
**Post date:** [March 1, 2011, 4:06pm UTC](https://discuss.elastic.co/t/new-to-elasticsearch/4002/2 "2011-03-01T16:06:01Z")

</div>

K.B.

```
I can't answer the rest, but I can answer the facets question, yes,

```

ElasticSearch does support facets:

[http://www.elasticsearch.org/guide/reference/api/search/facets/](http://www.elasticsearch.org/guide/reference/api/search/facets/)

```
	- Nick

```

-----Original Message-----  
From: K.B. [[mailto:korbinian.bachl@googlemail.com](mailto:korbinian.bachl@googlemail.com)]  
Sent: Tuesday, March 01, 2011 11:05 AM  
To: users  
Subject: new to ElasticSearch

Hello Group,  
Hello Shay,

i'm currently looking for an alternative to SOLR, as SOLRs java api  
SOLRJ is more a mess than useful. As a typical newbie, I got a few  
questions that I couldn't answer myself by looking at the doc's.

1. Does ElasticSearch offer Faceting?  
I looked at Query DSL doc but didn't see any faceting there;

2. How can I implement tree structures with ES?  
in SOLR, one can use a multi-valued field and insert there precompiled  
tree-structures like this:  
0\_Root  
1\_Root\_Foo  
1\_Root\_Foo2  
2\_Root\_Foo\_Bar  
2\_Root\_Foo\_Bar2  
and then facet over e.g. "1\_Root\_Foo" - does this work in ES, too?

3. I prefer to have the search solution sitting next to the webapp in  
the same server - is there any way one can deploy ElasticSearch as a  
war in an JEE Server like Glassfish 3?

Best,

K.B.

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [March 1, 2011, 4:18pm UTC](https://discuss.elastic.co/t/new-to-elasticsearch/4002/3 "2011-03-01T16:18:28Z")

</div>

Hi KB

> 1. How can I implement tree structures with ES?  
> in SOLR, one can use a multi-valued field and insert there precompiled  
> tree-structures like this:  
> 0\_Root  
> 1\_Root\_Foo  
> 1\_Root\_Foo2  
> 2\_Root\_Foo\_Bar  
> 2\_Root\_Foo\_Bar2  
> and then facet over e.g. "1\_Root\_Foo" - does this work in ES, too?

Yes you can.

You could just store your tree as eg:  
{  
ancestors: ["0\_Root", "1\_Root\_Foo", ...etc]  
}

Or if you have unique IDs, where (1 is the parent of 2, is the parent of  
5)

{  
ancestor\_ids: [1,2,5]  
}

> 1. I prefer to have the search solution sitting next to the webapp in  
> the same server - is there any way one can deploy Elasticsearch as a  
> war in an JEE Server like Glassfish 3?

Don't know about this, not a Java guy, but I think probably not. You  
can certainly have your Java client join the cluster as a non-data node,  
but integrating the whole ES server into your app server kinda defeats  
the object of scalability

clint

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 1, 2011, 6:47pm UTC](https://discuss.elastic.co/t/new-to-elasticsearch/4002/4 "2011-03-01T18:47:05Z")

</div>

Heya,

Just to add to clinton comment on JEE server, you can start ES embedded in your app server (not as a client, but as a full embedded (non client) node in the cluster). But, I would have run it as a standalone server myself and connect to it using a node client.

-shay.banon  
On Tuesday, March 1, 2011 at 6:18 PM, Clinton Gormley wrote:

> Hi KB
> 
> > 1. How can I implement tree structures with ES?  
> > in SOLR, one can use a multi-valued field and insert there precompiled  
> > tree-structures like this:  
> > 0\_Root  
> > 1\_Root\_Foo  
> > 1\_Root\_Foo2  
> > 2\_Root\_Foo\_Bar  
> > 2\_Root\_Foo\_Bar2  
> > and then facet over e.g. "1\_Root\_Foo" - does this work in ES, too?
> 
> Yes you can.
> 
> You could just store your tree as eg:  
> {  
> ancestors: ["0\_Root", "1\_Root\_Foo", ...etc]  
> }
> 
> Or if you have unique IDs, where (1 is the parent of 2, is the parent of  
> 5)
> 
> {  
> ancestor\_ids: [1,2,5]  
> }
> 
> > 1. I prefer to have the search solution sitting next to the webapp in  
> > the same server - is there any way one can deploy Elasticsearch as a  
> > war in an JEE Server like Glassfish 3?
> 
> Don't know about this, not a Java guy, but I think probably not. You  
> can certainly have your Java client join the cluster as a non-data node,  
> but integrating the whole ES server into your app server kinda defeats  
> the object of scalability
> 
> clint

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [March 1, 2011, 8:09pm UTC](https://discuss.elastic.co/t/new-to-elasticsearch/4002/5 "2011-03-01T20:09:43Z")

</div>

yeah, I'm running ES separate too.  
You also have the benefit that you can just reload the application and  
do not waste time or CPU for ES re-initialization.

And I'm really not sure what happens when you reload while ES is  
running embedded 🙂

Regards,  
Peter.

On 1 Mrz., 19:47, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Heya,
> 
> Just to add to clinton comment on JEE server, you can start ES embedded in your app server (not as a client, but as a full embedded (non client) node in the cluster). But, I would have run it as a standalone server myself and connect to it using a node client.
> 
> -shay.banon
> 
> On Tuesday, March 1, 2011 at 6:18 PM, Clinton Gormley wrote:
> 
> > Hi KB
> 
> > > 1. How can I implement tree structures with ES?  
> > > in SOLR, one can use a multi-valued field and insert there precompiled  
> > > tree-structures like this:  
> > > 0\_Root  
> > > 1\_Root\_Foo  
> > > 1\_Root\_Foo2  
> > > 2\_Root\_Foo\_Bar  
> > > 2\_Root\_Foo\_Bar2  
> > > and then facet over e.g. "1\_Root\_Foo" - does this work in ES, too?
> 
> > Yes you can.
> 
> > You could just store your tree as eg:  
> > {  
> > ancestors: ["0\_Root", "1\_Root\_Foo", ...etc]  
> > }
> 
> > Or if you have unique IDs, where (1 is the parent of 2, is the parent of  
> > 5)
> 
> > {  
> > ancestor\_ids: [1,2,5]  
> > }
> 
> > > 1. I prefer to have the search solution sitting next to the webapp in  
> > > the same server - is there any way one can deploy Elasticsearch as a  
> > > war in an JEE Server like Glassfish 3?
> 
> > Don't know about this, not a Java guy, but I think probably not. You  
> > can certainly have your Java client join the cluster as a non-data node,  
> > but integrating the whole ES server into your app server kinda defeats  
> > the object of scalability
> 
> > clint

---

<div class="post-metadata">

**Author:** ![K\_B](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@K\_B](https://discuss.elastic.co/u/K_B)\
**Post date:** [March 2, 2011, 10:23am UTC](https://discuss.elastic.co/t/new-to-elasticsearch/4002/6 "2011-03-02T10:23:42Z")

</div>

Thank you all for your responses!

A short follow up: I now also understand the doc's better - it's quite  
irritating to me that under [http://www.elasticsearch.org/guide/](http://www.elasticsearch.org/guide/) -\>  
Query the link goes to [http://www.elasticsearch.org/guide/reference/query-dsl/](http://www.elasticsearch.org/guide/reference/query-dsl/)  
that then shows much less information about queries compared to  
[http://www.elasticsearch.org/guide/reference/api/search/](http://www.elasticsearch.org/guide/reference/api/search/) - meaning I  
nearly would have posted another question regarding field-selecting  
because I didn't find the information I epxected in the doc's.

One thing that finally puzzles me a bit: how is the performance of ES  
whne queried from Java? SORL was quite OK as the results weren't  
transformed into any special format but beeing more pushed within the  
JVM's memory around - how does ES stand here?

Best,

Korbinian

---

<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 6, 2017, 4:11am UTC](https://discuss.elastic.co/t/new-to-elasticsearch/4002/7 "2017-07-06T04:11:01Z")

</div>


