# Cluster query to fetch particular label records in carrot2

**URL:** <https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283>\
**Category:** Elasticsearch\
**Created:** [March 11, 2014, 9:19am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283 "2014-03-11T09:19:41Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 11, 2014, 9:19am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/1 "2014-03-11T09:19:41Z")

</div>

Hi ES Users,

Is there any specific query which can be used to fetch the records of one particular label.

e.g.: Using \_search\_with\_clusters I got response as

**{id: 3  
score: 0.9494177601684511  
label: Nokia  
phrases: [  
Nokia  
]  
documents: [  
XQqcFFOlRDm7-FfIVz-U1A  
rXJT\_mKpQWKB9x9Zs2ipJw  
]  
}**

{  
id: 4  
score: 0.9399315182096429  
label: Samsung  
phrases: [  
Samsung  
]  
documents: [  
rXJT\_mKpQWKB9x9Zs2ipJw  
nxrIS71jRGqcJ1U11LPlJw  
]  
}

{  
id: 5  
score: 0.9353337839487279  
label: LG  
phrases: [  
LG  
]  
documents: [  
2wGWpV8OQXCPWwlnsm\_uCw  
nxrIS71jRGqcJ1U11LPlJw  
]  
}

Now suppose I want to filter the response for one particular label say Nokia so is there any query which I can fire to get the specific set of record?

---

<div class="post-metadata">

**Author:** ![Dawid\_Weiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dawid_weiss/32/1643_2.png) [@Dawid\_Weiss](https://discuss.elastic.co/u/Dawid_Weiss)\
**Post date:** [March 11, 2014, 9:22am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/2 "2014-03-11T09:22:13Z")

</div>

Add the cluster's label as a boolean must-occur phrase to your search query.

Dawid

On Tue, Mar 11, 2014 at 10:19 AM, prashy [prashant.agrawal@paladion.net](mailto:prashant.agrawal@paladion.net) wrote:

> Hi ES Users,
> 
> Is there any specific query which can be used to fetch the records of one  
> particular label.
> 
> e.g.: Using \_search\_with\_clusters I got response as
> 
> \*{id: 3  
> score: 0.9494177601684511  
> label: Nokia  
> phrases: [  
> Nokia  
> ]  
> documents: [  
> XQqcFFOlRDm7-FfIVz-U1A  
> rXJT\_mKpQWKB9x9Zs2ipJw  
> ]  
> }
> 
> {  
> id: 4  
> score: 0.9399315182096429  
> label: Samsung  
> phrases: [  
> Samsung  
> ]  
> documents: [  
> rXJT\_mKpQWKB9x9Zs2ipJw  
> nxrIS71jRGqcJ1U11LPlJw  
> ]  
> }
> 
> {  
> id: 5  
> score: 0.9353337839487279  
> label: LG  
> phrases: [  
> LG  
> ]  
> documents: [  
> 2wGWpV8OQXCPWwlnsm\_uCw  
> nxrIS71jRGqcJ1U11LPlJw  
> ]  
> }\*
> 
> Now suppose I want to filter the response for one particular label say Nokia  
> so is there any query which I can fire to get the specific set of record?
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485.html](http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1394529582225-4051485.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394529582225-4051485.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAM21Rt\_LVXwX4xJn8eJMOYA-zfZx%3Dxk0SuMZs9M1fb6XOZX4Rw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAM21Rt_LVXwX4xJn8eJMOYA-zfZx%3Dxk0SuMZs9M1fb6XOZX4Rw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 11, 2014, 9:33am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/3 "2014-03-11T09:33:42Z")

</div>

As the cluster labels will be known after performing one search query.  
So if my search query is:  
{  
"search\_request": {  
"Content"  
],  
"query": {  
"match": {  
"\_all": "mobile"  
}  
},  
"size": 1000,  
"from":0  
},  
"query\_hint": "mobile",  
"field\_mapping": {  
"content": [  
"fields.Content"  
]  
},  
"algorithm": "lingo3g"  
}

I will get the results as mentioned in previous post.

So what query should be executed if I knows that there is one cluster for "mobile" search as "Nokia".

> > Add the cluster's label as a boolean must-occur phrase to your search query.  
> > According to this you mean to say that I should execute like:  
> > {  
> > "search\_request": {  
> > "fields": [  
> > "Host",  
> > "URL",  
> > "Content"  
> > ],  
> > "query": {  
> > "bool": {  
> > "must": {  
> > "term": {  
> > "Content": "Nokia"  
> > }  
> > }  
> > }  
> > },  
> > "size": 1000,  
> > "from": 0  
> > },  
> > "query\_hint": "Nokia",  
> > "field\_mapping": {  
> > "content": [  
> > "fields.Content"  
> > ]  
> > },  
> > "algorithm": "lingo3g"  
> > }

Correct me if I am wrong.

---

<div class="post-metadata">

**Author:** ![Dawid\_Weiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dawid_weiss/32/1643_2.png) [@Dawid\_Weiss](https://discuss.elastic.co/u/Dawid_Weiss)\
**Post date:** [March 11, 2014, 10:07am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/4 "2014-03-11T10:07:14Z")

</div>

It would be probably better to add a filtering expression on top of  
your original query instead of replacing it entirely (so that a subset  
of original documents are matching).

Add a "filter" clause to your original "search\_request".

> **[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.

Dawid

On Tue, Mar 11, 2014 at 10:33 AM, prashy [prashant.agrawal@paladion.net](mailto:prashant.agrawal@paladion.net) wrote:

> As the cluster labels will be known after performing one search query.  
> So if my search query is:  
> {  
> "search\_request": {  
> "Content"  
> ],  
> "query": {  
> "match": {  
> "\_all": "mobile"  
> }  
> },  
> "size": 1000,  
> "from":0  
> },  
> "query\_hint": "mobile",  
> "field\_mapping": {  
> "content": [  
> "fields.Content"  
> ]  
> },  
> "algorithm": "lingo3g"  
> }
> 
> I will get the results as mentioned in previous post.
> 
> So what query should be executed if I knows that there is one cluster for  
> "mobile" search as "Nokia".
> 
> > > Add the cluster's label as a boolean must-occur phrase to your search  
> > > query.  
> > > According to this you mean to say that I should execute like:  
> > > {  
> > > "search\_request": {  
> > > "fields": [  
> > > "Host",  
> > > "URL",  
> > > "Content"  
> > > ],  
> > > "query": {  
> > > "bool": {  
> > > "must": {  
> > > "term": {  
> > > "Content": "Nokia"  
> > > }  
> > > }  
> > > }  
> > > },  
> > > "size": 1000,  
> > > "from": 0  
> > > },  
> > > "query\_hint": "Nokia",  
> > > "field\_mapping": {  
> > > "content": [  
> > > "fields.Content"  
> > > ]  
> > > },  
> > > "algorithm": "lingo3g"  
> > > }
> 
> Correct me if I am wrong.
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051487.html](http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051487.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1394530422299-4051487.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394530422299-4051487.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAM21Rt-baF2J2-fbGNuu8m%3Dt6khF6yd8oOocmfZLYx82DH0htg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAM21Rt-baF2J2-fbGNuu8m%3Dt6khF6yd8oOocmfZLYx82DH0htg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 11, 2014, 10:17am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/5 "2014-03-11T10:17:38Z")

</div>

By adding the filter clause it will filter the data and return the Cluster labels. But its not necessary that if I search with the cluster labels(as filter) so I will be getting the same records(same set of record ID in one particular cluster) as I will get in case of former query.

Just to explain my problem statement in terms of Cluster Website: [http://search.carrot2.org/](http://search.carrot2.org/)

If I search "mobile" in this page it will return the records in main body and labels on the left panel.  
So on clicking the label on left panel it will display the record wrt that particular label in main body.

At the end of my execution I want result like this only so any idea how I can proceed with that.  
Like on firing the query I will get the cluster labels now I want to display the data wrt each particular labels on user event.

Attached snapshots for the same.\<nabble\_img src="cluster.bmp" border="0"/\>

---

<div class="post-metadata">

**Author:** ![Dawid\_Weiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dawid_weiss/32/1643_2.png) [@Dawid\_Weiss](https://discuss.elastic.co/u/Dawid_Weiss)\
**Post date:** [March 11, 2014, 10:24am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/6 "2014-03-11T10:24:49Z")

</div>

Every clustering request may hit a different collection of documents  
so splitting it into  
multiple requests may not be a good idea.

The solution I offered will sort of work -- you just need to issue a  
regular search query (filtered with the cluster's label); the  
documents returned from Elastic search will revolve around the  
cluster's phrase and the original phrase, so it should be all right.

The code for the web site you provided a snapshot of is open source  
and is part of the Carrot2 project. The way the user interface works  
there is one query fetches both documents and clusters, the filtering  
is then done on client side (showing only a subset of documents for  
the original query for that particular cluster). You could do the same  
with the clustered results returned from ES -- the clusters contain  
document identifiers that link them back to the content of the  
original search query.

Dawid

On Tue, Mar 11, 2014 at 11:17 AM, prashy [prashant.agrawal@paladion.net](mailto:prashant.agrawal@paladion.net) wrote:

> By adding the filter cause it will filter the data and return the Cluster  
> labels. But its not necessary that if I search with the cluster labels(as  
> filter) so I will be getting the same records(same set of record ID in one  
> particular cluster) as I will get in case of former query.
> 
> Just to explain my problem statement in terms of Cluster Website:  
> [http://search.carrot2.org/](http://search.carrot2.org/) [http://search.carrot2.org/](http://search.carrot2.org/)
> 
> If I search "mobile" in this page it will return the records in main body  
> and labels on the left panel.  
> So on clicking the label on left panel it will display the record wrt that  
> particular label in main body.
> 
> At the end of my execution I want result like this only so any idea how I  
> can proceed with that.  
> Like on firing the query I will get the cluster labels now I want to display  
> the data wrt each particular labels on user event.
> 
> Attached snapshots for the same.  
> [http://elasticsearch-users.115913.n3.nabble.com/file/n4051495/cluster.bmp](http://elasticsearch-users.115913.n3.nabble.com/file/n4051495/cluster.bmp)
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051495.html](http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051495.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1394533058514-4051495.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394533058514-4051495.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAM21Rt8hrbJ\_oo3LCNAMNMjUw43LHjZMbNOEYCOQxS3B5xUXfQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAM21Rt8hrbJ_oo3LCNAMNMjUw43LHjZMbNOEYCOQxS3B5xUXfQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 11, 2014, 10:32am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/7 "2014-03-11T10:32:39Z")

</div>

I was also looking for one query to be fired and returned the result as well as cluster but I got stuck when it came to display the record of particular label.

> > The code for the web site you provided a snapshot of is open source and is part of the Carrot2 project.  
> > Can I get the UI code for this so that I can co-relate my requirements wrt this particular behaviour.

> > the clusters contain document identifiers that link them back to the content of the original search query.  
> > How I can achieve this i.e. retrieving the identifiers for particular label and displaying it back to UI.

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 11, 2014, 11:21am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/8 "2014-03-11T11:21:22Z")

</div>

- deleted -

---

<div class="post-metadata">

**Author:** ![Dawid\_Weiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dawid_weiss/32/1643_2.png) [@Dawid\_Weiss](https://discuss.elastic.co/u/Dawid_Weiss)\
**Post date:** [March 11, 2014, 11:30am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/9 "2014-03-11T11:30:28Z")

</div>

I'm sorry but you need to take some initiative too. Questions like this one:

> Can I get the UI code for this so that I can co-relate my requirements wrt this particular behaviour.

really discourage me from trying to help you. I've pointed you at the  
project, it's really 5 minutes work to check it out from github and  
look at where the web application is.

I hope you won't take it personally, but I think you should read this  
document. Smart questions yield better answers.

[http://www.catb.org/esr/faqs/smart-questions.html#before](http://www.catb.org/esr/faqs/smart-questions.html#before)

Dawid

On Tue, Mar 11, 2014 at 12:21 PM, prashy [prashant.agrawal@paladion.net](mailto:prashant.agrawal@paladion.net) wrote:

> Hi Dawid,
> 
> Any input for the above problem case?
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051507.html](http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051507.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1394536882990-4051507.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394536882990-4051507.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAM21Rt8bOy0PbK-L4oHBPQMjY0MxPnGVu2GO%3Dp5%2Bb6ve2S\_0HA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAM21Rt8bOy0PbK-L4oHBPQMjY0MxPnGVu2GO%3Dp5%2Bb6ve2S_0HA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 11, 2014, 12:06pm UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/10 "2014-03-11T12:06:24Z")

</div>

Sorry If I have asked a question which is not relevant to forum.  
I explored the Project repository already and what I got for Web App is war file at [http://project.carrot2.org/download.html](http://project.carrot2.org/download.html)

But I was just thinking if there is any source code(html files) instead of war files to check for some html page rendering and all.

---

<div class="post-metadata">

**Author:** ![Dawid\_Weiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dawid_weiss/32/1643_2.png) [@Dawid\_Weiss](https://discuss.elastic.co/u/Dawid_Weiss)\
**Post date:** [March 11, 2014, 12:09pm UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/11 "2014-03-11T12:09:10Z")

</div>

Did you try the "source code" link?...

[http://project.carrot2.org/source-code.html](http://project.carrot2.org/source-code.html)

On Tue, Mar 11, 2014 at 1:06 PM, prashy [prashant.agrawal@paladion.net](mailto:prashant.agrawal@paladion.net) wrote:

> Sorry If I have asked a question which is not relevant to forum.  
> I explored the Project repository already and what I got for Web App is war  
> file at [http://project.carrot2.org/download.html](http://project.carrot2.org/download.html)  
> [http://project.carrot2.org/download.html](http://project.carrot2.org/download.html)
> 
> But I was just thinking if there is any source code(html files) instead of  
> war files to check for some html page rendering and all.
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051525.html](http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051525.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1394539584840-4051525.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394539584840-4051525.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAM21Rt8T-osK39h\_NzfamTmKQ\_gfiF%3D4LJabUc%3DQM8%2BY0d2d-w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAM21Rt8T-osK39h_NzfamTmKQ_gfiF%3D4LJabUc%3DQM8%2BY0d2d-w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 11, 2014, 12:24pm UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/12 "2014-03-11T12:24:05Z")

</div>

Yes I checked this link as well till the web app. Which is having the code altogether as java code.

What I thought is if we are doing any search just through json request in html pages so it is storing some info as cookies in client side and through HTML pages only the results are being retrieved later on click of label name.

As I don't have working experience in Java so I didn't go through in depth of code and was thinking there are some html files only to retrieve the data (just like the example of data mining is there in carrot2 plugin).

---

<div class="post-metadata">

**Author:** ![Dawid\_Weiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dawid_weiss/32/1643_2.png) [@Dawid\_Weiss](https://discuss.elastic.co/u/Dawid_Weiss)\
**Post date:** [March 11, 2014, 12:26pm UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/13 "2014-03-11T12:26:56Z")

</div>

The part you're interested in is in JavaScript. It won't be easy to  
pull out and it's not a particularly nice piece of code (we plan to  
change it to something nicer, but there's never enough time).

[https://github.com/carrot2/carrot2/tree/master/applications/carrot2-webapp/web/skins](https://github.com/carrot2/carrot2/tree/master/applications/carrot2-webapp/web/skins)

On Tue, Mar 11, 2014 at 1:24 PM, prashy [prashant.agrawal@paladion.net](mailto:prashant.agrawal@paladion.net) wrote:

> Yes I checked this link as well till the web app. Which is having the code  
> altogether as java code.
> 
> What I thought is if we are doing any search just through json request in  
> html pages so it is storing some info as cookies in client side and through  
> HTML pages only the results are being retrieved later on click of label  
> name.
> 
> As I don't have working experience in Java so I didn't go through in depth  
> of code and was thinking there are some html files only to retrieve the data  
> (just like the example of data mining is there in carrot2 plugin).
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051532.html](http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051532.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1394540645462-4051532.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394540645462-4051532.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAM21Rt\_pjn0eyaMAZnaincrZZfMUKDwX%3DnFgJgCZK-WsHp\_wCg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAM21Rt_pjn0eyaMAZnaincrZZfMUKDwX%3DnFgJgCZK-WsHp_wCg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 11, 2014, 12:39pm UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/14 "2014-03-11T12:39:19Z")

</div>

Yes that's what I was looking for throughout the source code and not able to pullout.

What I was interested to know through the source code is "How data is handled on web after firing the first query(which returns the set of cluster labels and on user event we can navigate through various labels)" that I was unable to locate properly in source code.

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 11, 2014, 1:31pm UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/15 "2014-03-11T13:31:05Z")

</div>

It could be a silly question but just wanted to know that can we integrate the carrot2 web application with our Elasticsearch instance?

---

<div class="post-metadata">

**Author:** ![Dawid\_Weiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dawid_weiss/32/1643_2.png) [@Dawid\_Weiss](https://discuss.elastic.co/u/Dawid_Weiss)\
**Post date:** [March 11, 2014, 1:51pm UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/16 "2014-03-11T13:51:52Z")

</div>

Not without some code-writing (in Java). You'd have to add an  
IDocumentSource implementation that would access your ES for documents  
matching user's query. This isn't that difficult, but requires some  
changes to the source code and recompiling Carrot2. Look at the Solr  
document source, for example; ES would be quite similar:

[https://github.com/carrot2/carrot2/tree/master/core/carrot2-source-solr/src/org/carrot2/source/solr](https://github.com/carrot2/carrot2/tree/master/core/carrot2-source-solr/src/org/carrot2/source/solr)

Dawid

On Tue, Mar 11, 2014 at 2:31 PM, prashy [prashant.agrawal@paladion.net](mailto:prashant.agrawal@paladion.net) wrote:

> It could be a silly question but just wanted to know that can we integrate  
> the carrot2 web application with our Elasticsearch instance?
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051544.html](http://elasticsearch-users.115913.n3.nabble.com/Cluster-query-to-fetch-particular-label-records-in-carrot2-tp4051485p4051544.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1394544666935-4051544.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394544666935-4051544.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAM21Rt9m3em9aHbr%2BR-csyS%3DxTiNs4ns0vG6uJVhTbES1L9fxw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAM21Rt9m3em9aHbr%2BR-csyS%3DxTiNs4ns0vG6uJVhTbES1L9fxw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Prashant\_Pal](https://avatars.discourse-cdn.com/v4/letter/p/b77776/32.png) [@Prashant\_Pal](https://discuss.elastic.co/u/Prashant_Pal)\
**Post date:** [March 19, 2014, 7:36am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/17 "2014-03-19T07:36:46Z")

</div>

While I click on the label name on left hand side of [search.carrot2.org](http://search.carrot2.org) then how exactly the query is being processed to ES.

i.e.

1. Is there any cookie or structure is maintained for docIDs on web GUI, wrt each labels. So that on click event we can fetch the records wrt specified ID from ES.

2. Are we sending another query to ES on click of label to retrieve the data wrt that label if yes then what type of query it is (is it normal search query by IDs or some other query)

Note: Search on [search.carrot2.org](http://search.carrot2.org) is not working properly its giving the exception as **org.carrot2.source.etools.IpBannedException: org.apache.http.client.HttpResponseException: Forbidden**

---

<div class="post-metadata">

**Author:** ![Dawid\_Weiss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dawid_weiss/32/1643_2.png) [@Dawid\_Weiss](https://discuss.elastic.co/u/Dawid_Weiss)\
**Post date:** [March 19, 2014, 8:25am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/18 "2014-03-19T08:25:10Z")

</div>

> While I click on the label name on left hand side of [search.carrot2.org](http://search.carrot2.org)  
> [http://search.carrot2.org](http://search.carrot2.org) then how exactly the query is being processed  
> to ES.

This search is not driven by ES, so your question has no answer.

> 1. Is there any cookie or structure is maintained for docIDs on web GUI, wrt  
> each labels. So that on click event we can fetch the records wrt specified  
> ID from ES.

All documents and clusters are stored in the user interface. Clusters  
map to document IDs and the filtering/ redisplay is done via JS,  
without additional queries.

> Note: Search on [search.carrot2.org](http://search.carrot2.org) [http://search.carrot2.org](http://search.carrot2.org) is not  
> working properly its giving the exception as  
> _org.carrot2.source.etools.IpBannedException:  
> org.apache.http.client.HttpResponseException: Forbidden_

It is working properly. You've exceeded the request limit for your IP  
address, it's a simple spam-blocker.

Dawid

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAM21Rt9tt5b3QhbPNzVTtCCVK6BinYp2bTZ782cd%3DiEDsi28Zw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAM21Rt9tt5b3QhbPNzVTtCCVK6BinYp2bTZ782cd%3DiEDsi28Zw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:42am UTC](https://discuss.elastic.co/t/cluster-query-to-fetch-particular-label-records-in-carrot2/16283/19 "2017-07-06T01:42:18Z")

</div>


