# Using Facets

**URL:** https://discuss.elastic.co/t/using-facets/9900
**Category:** Elasticsearch
**Created:** [November 30, 2012, 8:20am UTC](https://discuss.elastic.co/t/using-facets/9900 "2012-11-30T08:20:43Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![evil80](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@evil80](https://discuss.elastic.co/u/evil80)
#### Post date: [November 30, 2012, 8:20am UTC](https://discuss.elastic.co/t/using-facets/9900/1 "2012-11-30T08:20:43Z")

</div>

Hi,

I'm new to ES and I'm start building a web application based on it.

I've read that Faces allows to filter the result of a query, but in a web  
scenario after I bind the first result query to a control (let say a table)  
if I want to filter it with the Facets I have to re-run my query ?  
What is the common architecture use ?

I think it's not a good idea to store the result of the query in the user  
session.

I just want to start with develping a simple web page to discover the power  
of ES and understand how it can interact with a web application.

Thanks

--

---

<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: [November 30, 2012, 8:33am UTC](https://discuss.elastic.co/t/using-facets/9900/2 "2012-11-30T08:33:14Z")

</div>

Have a look at my JUG/Devoxx demo web site :  
[http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)

Source code is here: [GitHub - dadoonet/devoxxfr\_demo: Twitter Demo for Devoxx France (Deprecated)](https://github.com/dadoonet/devoxxfr_demo)

It could help to build your demo (or you can use it as is)

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 30 nov. 2012 à 09:20, evil80 [archivio@inbox.com](mailto:archivio@inbox.com) a écrit :

> Hi,
> 
> I'm new to ES and I'm start building a web application based on it.
> 
> I've read that Faces allows to filter the result of a query, but in a web scenario after I bind the first result query to a control (let say a table) if I want to filter it with the Facets I have to re-run my query ?  
> What is the common architecture use ?
> 
> I think it's not a good idea to store the result of the query in the user session.
> 
> I just want to start with develping a simple web page to discover the power of ES and understand how it can interact with a web application.
> 
> ## Thanks

--

---

<div class="post-metadata">

### Author: ![evil80](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@evil80](https://discuss.elastic.co/u/evil80)
#### Post date: [November 30, 2012, 1:44pm UTC](https://discuss.elastic.co/t/using-facets/9900/3 "2012-11-30T13:44:49Z")

</div>

I need to develop a web application that allow a user to search.  
The application will start with 10TB of data must have a realtime response.

The search engine will be so simple, at the beginning.  
Imagine to have a document with these field :

- Data
- Branch code
- Article number
- Sell price

I have to give to a user a web page in which he can simply enter the value  
and return all the matches document.

Do you think ES can handle this volume of data ? Millions of documents for  
an initial size of 10TB.  
I'm going to use .NET to develop the frontend because it's my favorite  
platform (I'm evaluating to use bootstrap as your demo too).

What kind of query can better perform on ES in this scenario ?  
Facets can be return together with the main query and applied in a second  
time on the client ?

I've seen that your example is developed in Javascript, it could be  
difficult to build something like that with a server-side technology like  
[Asp.NET](http://Asp.NET) ?

Thanks a lot!  
Il giorno venerdì 30 novembre 2012 09:33:14 UTC+1, David Pilato ha scritto:

> Have a look at my JUG/Devoxx demo web site :  
> [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)
> 
> Source code is here: [GitHub - dadoonet/devoxxfr\_demo: Twitter Demo for Devoxx France (Deprecated)](https://github.com/dadoonet/devoxxfr_demo)
> 
> It could help to build your demo (or you can use it as is)
> 
> ## HTH
> 
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 30 nov. 2012 à 09:20, evil80 \<[arch...@inbox.com](mailto:arch...@inbox.com) \<javascript:\>\> a  
> écrit :
> 
> Hi,
> 
> I'm new to ES and I'm start building a web application based on it.
> 
> I've read that Faces allows to filter the result of a query, but in a web  
> scenario after I bind the first result query to a control (let say a table)  
> if I want to filter it with the Facets I have to re-run my query ?  
> What is the common architecture use ?
> 
> I think it's not a good idea to store the result of the query in the user  
> session.
> 
> I just want to start with develping a simple web page to discover the  
> power of ES and understand how it can interact with a web application.
> 
> Thanks
> 
> --

--

---

<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: [November 30, 2012, 2:33pm UTC](https://discuss.elastic.co/t/using-facets/9900/4 "2012-11-30T14:33:12Z")

</div>

I would say: "it depends!" 😉

On my laptop, I built a demo with 1,3 m docs (more than 100 fields) with 5  
facets (Terms, Range, Date histogram).  
When computing on the full dataset, I get results in about 8-10 seconds.  
When adding a query on top of it (and reduce my data set to 100k docs), I get  
results in less than a second.

On a Laptop and with only 1,5 Gb allocated to the JVM ! It was just amazing.

With a real server (64 Gb RAM with 32 Gb for ES), you will get really better  
performance and you will be able to handle more documents 😉

Yes, you can build your application from every langage as everything is standard  
in Elasticsearch (REST API)...

HTH  
David.

Le 30 novembre 2012 à 14:44, evil80 [archivio@inbox.com](mailto:archivio@inbox.com) a écrit :

> I need to develop a web application that allow a user to search.  
> The application will start with 10TB of data must have a realtime response.
> 
> The search engine will be so simple, at the beginning.  
> Imagine to have a document with these field :  
> \* Data  
> \* Branch code  
> \* Article number  
> \* Sell price
> 
> I have to give to a user a web page in which he can simply enter the value  
> and return all the matches document.
> 
> Do you think ES can handle this volume of data ? Millions of documents for an  
> initial size of 10TB.
> 
> I'm going to use .NET to develop the frontend because it's my favorite  
> platform (I'm evaluating to use bootstrap as your demo too).
> 
> What kind of query can better perform on ES in this scenario ?  
> Facets can be return together with the main query and applied in a second  
> time on the client ?
> 
> I've seen that your example is developed in Javascript, it could be difficult  
> to build something like that with a server-side technology like [Asp.NET](http://Asp.NET) ?
> 
> Thanks a lot!  
> Il giorno venerdì 30 novembre 2012 09:33:14 UTC+1, David Pilato ha scritto:
> 
> > > Have a look at my JUG/Devoxx demo web site :  
> > > [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/) [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> > > [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> > > Source code is here: [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> > > [GitHub - dadoonet/devoxxfr\_demo: Twitter Demo for Devoxx France (Deprecated)](https://github.com/dadoonet/devoxxfr_demo)  
> > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > It could help to build your demo (or you can use it as is)  
> > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > HTH  
> > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > --  
> > > David 😉 [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 30 nov. 2012 à 09:20, evil80 \<  
> > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo) [arch...@inbox.com](mailto:arch...@inbox.com)\> a écrit :
> > 
> > ```
> > > > > Hi,
> > 
> > ```
> > 
> > > ```
> > > I'm new to ES and I'm start building a web application based on it.
> > > 
> > > I've read that Faces allows to filter the result of a query, but in
> > > 
> > > ```
> > > 
> > > a web scenario after I bind the first result query to a control (let say a  
> > > table) if I want to filter it with the Facets I have to re-run my query ?  
> > > What is the common architecture use ?
> > > 
> > > ```
> > > I think it's not a good idea to store the result of the query in
> > > 
> > > ```
> > > 
> > > the user session.
> > > 
> > > ```
> > > I just want to start with develping a simple web page to discover
> > > 
> > > ```
> > > 
> > > the power of ES and understand how it can interact with a web application.
> > > 
> > > ```
> > > Thanks
> > > 
> > > --
> > > 
> > > ```
> > > 
> > > > > >
> 
> --

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

### Author: ![evil80](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@evil80](https://discuss.elastic.co/u/evil80)
#### Post date: [November 30, 2012, 2:45pm UTC](https://discuss.elastic.co/t/using-facets/9900/5 "2012-11-30T14:45:39Z")

</div>

Ok! It's seem to be wonderful!

If I'm not boring you I want to understand the main architecture, I'm going  
to build something like this :

- [Asp.NET](http://Asp.NET) Frontend
- I build a request for ES and get the result (maybe using NEST and not  
JSon directly)
- Bind the result to the user on table, charts and so on

It's a good way for ES or there are some "best practices" ?

With this type of data :

- Datetime
- Branch code
- Article number
- Sell price

How can Facets improve the user experience ?  
I'm reading about that but I can't really understand what facets filter,  
facets histogram and so on can help me in developing this.

Really, really thanks!  
Il giorno venerdì 30 novembre 2012 15:33:12 UTC+1, David Pilato ha scritto:

> I would say: "it depends!" 😉
> 
> On my laptop, I built a demo with 1,3 m docs (more than 100 fields) with  
> 5 facets (Terms, Range, Date histogram).  
> When computing on the full dataset, I get results in about 8-10 seconds.  
> When adding a query on top of it (and reduce my data set to 100k docs), I  
> get results in less than a second.
> 
> On a Laptop and with only 1,5 Gb allocated to the JVM ! It was just  
> amazing.
> 
> With a real server (64 Gb RAM with 32 Gb for ES), you will get really  
> better performance and you will be able to handle more documents 😉
> 
> Yes, you can build your application from every langage as everything is  
> standard in Elasticsearch (REST API)...
> 
> HTH  
> David.
> 
> Le 30 novembre 2012 à 14:44, evil80 \<[arch...@inbox.com](mailto:arch...@inbox.com) \<javascript:\>\> a  
> écrit :
> 
> I need to develop a web application that allow a user to search.  
> The application will start with 10TB of data must have a realtime  
> response.
> 
> The search engine will be so simple, at the beginning.  
> Imagine to have a document with these field :
> 
> - Data
> - Branch code
> - Article number
> - Sell price
> 
> I have to give to a user a web page in which he can simply enter the value  
> and return all the matches document.
> 
> Do you think ES can handle this volume of data ? Millions of documents for  
> an initial size of 10TB.  
> I'm going to use .NET to develop the frontend because it's my favorite  
> platform (I'm evaluating to use bootstrap as your demo too).
> 
> What kind of query can better perform on ES in this scenario ?  
> Facets can be return together with the main query and applied in a second  
> time on the client ?
> 
> I've seen that your example is developed in Javascript, it could be  
> difficult to build something like that with a server-side technology like  
> [Asp.NET](http://Asp.NET) ?
> 
> Thanks a lot!  
> Il giorno venerdì 30 novembre 2012 09:33:14 UTC+1, David Pilato ha  
> scritto:
> 
> ## Have a look at my JUG/Devoxx demo web site : [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/) [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/) Source code is here: [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/) [GitHub - dadoonet/devoxxfr\_demo: Twitter Demo for Devoxx France (Deprecated)](https://github.com/dadoonet/devoxxfr_demo) [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo) It could help to build your demo (or you can use it as is)[https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo) [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo) HTH [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)
> 
> David 😉 [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 30 nov. 2012 à 09:20, evil80 \<[https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> [arch...@inbox.com](mailto:arch...@inbox.com)\> a écrit :
> 
> Hi,
> 
> I'm new to ES and I'm start building a web application based on it.
> 
> I've read that Faces allows to filter the result of a query, but in a web  
> scenario after I bind the first result query to a control (let say a table)  
> if I want to filter it with the Facets I have to re-run my query ?  
> What is the common architecture use ?
> 
> I think it's not a good idea to store the result of the query in the user  
> session.
> 
> I just want to start with develping a simple web page to discover the  
> power of ES and understand how it can interact with a web application.
> 
> Thanks
> 
> --
> 
> --
> 
> --  
> David Pilato  
> [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<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: [November 30, 2012, 5:33pm UTC](https://discuss.elastic.co/t/using-facets/9900/6 "2012-11-30T17:33:03Z")

</div>

Sounds good to me.

With facets, you can help the user click on it and filter then the first results  
(and digg into your documents). If you click on facets on my demo, you will see  
this in action.  
A common use case is the commerce web site. You should read this wonderful post  
from Karel (aka Karmi)

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

I learned everything about facets from this article.

For your data, it depends on what you want to show to your users.  
That said, I think that Date Histogram will be useful for your Datetime values,  
Term Facet for your Branch code, Range facet for Sell price.  
I don't understand what are article numbers or if I understood well (it's a  
unique number/id ?), I can't see a facet for it.

Does it help?  
David.

Le 30 novembre 2012 à 15:45, evil80 [archivio@inbox.com](mailto:archivio@inbox.com) a écrit :

> Ok! It's seem to be wonderful!
> 
> If I'm not boring you I want to understand the main architecture, I'm going  
> to build something like this :  
> \* [Asp.NET](http://Asp.NET) Frontend  
> \* I build a request for ES and get the result (maybe using NEST and not  
> JSon directly)  
> \* Bind the result to the user on table, charts and so on
> 
> It's a good way for ES or there are some "best practices" ?
> 
> With this type of data :
> 
> ```
> * Datetime
> * Branch code
> * Article number
> * Sell price
> 
> ```
> 
> How can Facets improve the user experience ?  
> I'm reading about that but I can't really understand what facets filter,  
> facets histogram and so on can help me in developing this.
> 
> Really, really thanks!
> 
> Il giorno venerdì 30 novembre 2012 15:33:12 UTC+1, David Pilato ha scritto:
> 
> > > I would say: "it depends!" 😉
> > 
> > On my laptop, I built a demo with 1,3 m docs (more than 100 fields) with  
> > 5 facets (Terms, Range, Date histogram).  
> > When computing on the full dataset, I get results in about 8-10 seconds.  
> > When adding a query on top of it (and reduce my data set to 100k docs), I  
> > get results in less than a second.
> > 
> > On a Laptop and with only 1,5 Gb allocated to the JVM ! It was just  
> > amazing.
> > 
> > With a real server (64 Gb RAM with 32 Gb for ES), you will get really  
> > better performance and you will be able to handle more documents 😉
> > 
> > Yes, you can build your application from every langage as everything is  
> > standard in Elasticsearch (REST API)...
> > 
> > HTH  
> > David.
> > 
> > Le 30 novembre 2012 à 14:44, evil80 \< [arch...@inbox.com](mailto:arch...@inbox.com)\> a écrit :
> > 
> > ```
> > > > > I need to develop a web application that allow a user to search.
> > 
> > ```
> > 
> > > ```
> > > The application will start with 10TB of data must have a realtime
> > > 
> > > ```
> > > 
> > > response.
> > > 
> > > ```
> > > The search engine will be so simple, at the beginning.
> > > Imagine to have a document with these field :
> > > * Data
> > > * Branch code
> > > * Article number
> > > * Sell price
> > > 
> > > I have to give to a user a web page in which he can simply enter the
> > > 
> > > ```
> > > 
> > > value and return all the matches document.
> > > 
> > > ```
> > > Do you think ES can handle this volume of data ? Millions of documents
> > > 
> > > ```
> > > 
> > > for an initial size of 10TB.
> > > 
> > > ```
> > > I'm going to use .NET to develop the frontend because it's my favorite
> > > 
> > > ```
> > > 
> > > platform (I'm evaluating to use bootstrap as your demo too).
> > > 
> > > ```
> > > What kind of query can better perform on ES in this scenario ?
> > > Facets can be return together with the main query and applied in a
> > > 
> > > ```
> > > 
> > > second time on the client ?
> > > 
> > > ```
> > > I've seen that your example is developed in Javascript, it could be
> > > 
> > > ```
> > > 
> > > difficult to build something like that with a server-side technology like  
> > > [Asp.NET](http://Asp.NET) ?
> > > 
> > > ```
> > > Thanks a lot!
> > > Il giorno venerdì 30 novembre 2012 09:33:14 UTC+1, David Pilato ha
> > > 
> > > ```
> > > 
> > > scritto:  
> > > \> \> \> \> Have a look at my JUG/Devoxx demo web site :
> > > 
> > > > ```
> > > > http://www.pilato.fr/devoxxfr_demo/
> > > > 
> > > > ```
> > > > 
> > > > [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> > > > [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> > > > [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> > > > [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> > > > Source code is here: [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> > > > [GitHub - dadoonet/devoxxfr\_demo: Twitter Demo for Devoxx France (Deprecated)](https://github.com/dadoonet/devoxxfr_demo)  
> > > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > > It could help to build your demo (or you can use it as is)  
> > > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > > HTH  
> > > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > > --  
> > > > David 😉 [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > ```
> > > > Le 30 nov. 2012 à 09:20, evil80 <
> > > > 
> > > > ```
> > > > 
> > > > [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo) [arch...@inbox.com](mailto:arch...@inbox.com)\> a écrit :
> > > > 
> > > > ```
> > > > > > > > > Hi,
> > > > 
> > > > ```
> > > > 
> > > > > ```
> > > > > I'm new to ES and I'm start building a web application based
> > > > > 
> > > > > ```
> > > > > 
> > > > > on it.
> > > > > 
> > > > > ```
> > > > > I've read that Faces allows to filter the result of a query,
> > > > > 
> > > > > ```
> > > > > 
> > > > > but in a web scenario after I bind the first result query to a control  
> > > > > (let say a table) if I want to filter it with the Facets I have to  
> > > > > re-run my query ?  
> > > > > What is the common architecture use ?
> > > > > 
> > > > > ```
> > > > > I think it's not a good idea to store the result of the
> > > > > 
> > > > > ```
> > > > > 
> > > > > query in the user session.
> > > > > 
> > > > > ```
> > > > > I just want to start with develping a simple web page to
> > > > > 
> > > > > ```
> > > > > 
> > > > > discover the power of ES and understand how it can interact with a web  
> > > > > application.
> > > > > 
> > > > > ```
> > > > > Thanks
> > > > > 
> > > > > --
> > > > > 
> > > > > > > > > > > > 
> > > > > 
> > > > > ```
> > > 
> > > ```
> > > --
> > > 
> > > ```
> > > 
> > > > >
> > 
> > --  
> > David Pilato  
> > [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/) [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> > [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/) [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > >
> 
> --

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

### Author: ![evil80](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@evil80](https://discuss.elastic.co/u/evil80)
#### Post date: [November 30, 2012, 10:57pm UTC](https://discuss.elastic.co/t/using-facets/9900/7 "2012-11-30T22:57:11Z")

</div>

Hi,

really really interesting!  
Now I have understood what Facets are...cool!

So each time user ask for a particolar Facets this would be a call to ES ?  
Facets can work on the over data set and returned indepently by the current  
query ?

Really thanks a lot!

Il giorno venerdì 30 novembre 2012 18:33:03 UTC+1, David Pilato ha scritto:

> Sounds good to me.
> 
> With facets, you can help the user click on it and filter then the first  
> results (and digg into your documents). If you click on facets on my demo,  
> you will see this in action.  
> A common use case is the commerce web site. You should read this  
> wonderful post from Karel (aka Karmi)  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/2011/05/13/data-visualization-with-elasticsearch-and-protovis.html)
> 
> I learned everything about facets from this article.
> 
> For your data, it depends on what you want to show to your users.  
> That said, I think that Date Histogram will be useful for your Datetime  
> values, Term Facet for your Branch code, Range facet for Sell price.  
> I don't understand what are article numbers or if I understood well (it's  
> a unique number/id ?), I can't see a facet for it.
> 
> Does it help?  
> David.
> 
> Le 30 novembre 2012 à 15:45, evil80 \<[arch...@inbox.com](mailto:arch...@inbox.com) \<javascript:\>\> a  
> écrit :
> 
> Ok! It's seem to be wonderful!
> 
> If I'm not boring you I want to understand the main architecture, I'm  
> going to build something like this :
> 
> - [Asp.NET](http://Asp.NET) Frontend
> - I build a request for ES and get the result (maybe using NEST and  
> not JSon directly)
> - Bind the result to the user on table, charts and so on
> 
> It's a good way for ES or there are some "best practices" ?
> 
> With this type of data :
> 
> - Datetime
> - Branch code
> - Article number
> - Sell price
> 
> How can Facets improve the user experience ?  
> I'm reading about that but I can't really understand what facets filter,  
> facets histogram and so on can help me in developing this.
> 
> Really, really thanks!  
> Il giorno venerdì 30 novembre 2012 15:33:12 UTC+1, David Pilato ha  
> scritto:
> 
> I would say: "it depends!" 😉
> 
> On my laptop, I built a demo with 1,3 m docs (more than 100 fields) with  
> 5 facets (Terms, Range, Date histogram).  
> When computing on the full dataset, I get results in about 8-10 seconds.  
> When adding a query on top of it (and reduce my data set to 100k docs), I  
> get results in less than a second.
> 
> On a Laptop and with only 1,5 Gb allocated to the JVM ! It was just  
> amazing.
> 
> With a real server (64 Gb RAM with 32 Gb for ES), you will get really  
> better performance and you will be able to handle more documents 😉
> 
> Yes, you can build your application from every langage as everything is  
> standard in Elasticsearch (REST API)...
> 
> HTH  
> David.
> 
> Le 30 novembre 2012 à 14:44, evil80 \< [arch...@inbox.com](mailto:arch...@inbox.com)\> a écrit :
> 
> I need to develop a web application that allow a user to search.  
> The application will start with 10TB of data must have a realtime  
> response.
> 
> The search engine will be so simple, at the beginning.  
> Imagine to have a document with these field :
> 
> - Data
> - Branch code
> - Article number
> - Sell price
> 
> I have to give to a user a web page in which he can simply enter the value  
> and return all the matches document.
> 
> Do you think ES can handle this volume of data ? Millions of documents for  
> an initial size of 10TB.  
> I'm going to use .NET to develop the frontend because it's my favorite  
> platform (I'm evaluating to use bootstrap as your demo too).
> 
> What kind of query can better perform on ES in this scenario ?  
> Facets can be return together with the main query and applied in a second  
> time on the client ?
> 
> I've seen that your example is developed in Javascript, it could be  
> difficult to build something like that with a server-side technology like  
> [Asp.NET](http://Asp.NET) ?
> 
> Thanks a lot!  
> Il giorno venerdì 30 novembre 2012 09:33:14 UTC+1, David Pilato ha  
> scritto:
> 
> Have a look at my JUG/Devoxx demo web site :  
> [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)[http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/)  
> Source code is here: [http://www.pilato.fr/devoxxfr\_demo/](http://www.pilato.fr/devoxxfr_demo/) [GitHub - dadoonet/devoxxfr\_demo: Twitter Demo for Devoxx France (Deprecated)](https://github.com/dadoonet/devoxxfr_demo)
> 
> ## [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo) [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)[https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo) It could help to build your demo (or you can use it as is)[https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo) [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo) HTH [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)
> 
> David 😉 [https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 30 nov. 2012 à 09:20, evil80 \<[https://github.com/dadoonet/devoxxfr\_demo](https://github.com/dadoonet/devoxxfr_demo)  
> [arch...@inbox.com](mailto:arch...@inbox.com)\> a écrit :
> 
> Hi,
> 
> I'm new to ES and I'm start building a web application based on it.
> 
> I've read that Faces allows to filter the result of a query, but in a web  
> scenario after I bind the first result query to a control (let say a table)  
> if I want to filter it with the Facets I have to re-run my query ?  
> What is the common architecture use ?
> 
> I think it's not a good idea to store the result of the query in the user  
> session.
> 
> I just want to start with develping a simple web page to discover the  
> power of ES and understand how it can interact with a web application.
> 
> Thanks
> 
> --
> 
> --
> 
> --  
> David Pilato  
> [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> --
> 
> --  
> David Pilato  
> [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<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, 3:01am UTC](https://discuss.elastic.co/t/using-facets/9900/8 "2017-07-06T03:01:55Z")

</div>


