Elastic search aggregations buckets counting email format as two different bucket key .

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Elastic search aggregations buckets counting email format as two different bucket key .

Rajesh Sindhu

I have field stored as "[hidden email] " .

Using aggregations json query :

"aggregations": {
                "email-terms": {
                    "terms": {
                        "field": "l_obj.email",
                        "size": 0,
                        "shard_size": 0,
                        "order": {
                            "_count": "desc"
                        }
                    }
                }
            }


I am getting response :

"buckets" : [
{
"key" : "user.com",
"doc_count" : 1
},
{
"key" : "user1",
"doc_count" : 1
}

instead of

"buckets" : [
{
"key" : "[hidden email]",
"doc_count" : 1
}
]

Same issue persists for string type likes : user1.user2.user.com ,I am doing terms aggregations . Am i missing something here ?


--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c70c288c-f8f2-4239-a8e9-55640c6945e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Elastic search aggregations buckets counting email format as two different bucket key .

Glen Smith
There is a bucket for each indexed term for the selected field, not for each stored value.

Whatever tokenizer you are using on that field is dividing the text at the "@" symbol.

If you want buckets for the exact value of the field, you need a not_analyzed field.

On Wednesday, April 15, 2015 at 8:15:52 PM UTC-4, Rajesh Sindhu wrote:

I have field stored as "<a href="javascript:" target="_blank" gdf-obfuscated-mailto="19vTTkUhq_oJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">us...@... " .

Using aggregations json query :

"aggregations": {
                "email-terms": {
                    "terms": {
                        "field": "l_obj.email",
                        "size": 0,
                        "shard_size": 0,
                        "order": {
                            "_count": "desc"
                        }
                    }
                }
            }


I am getting response :

"buckets" : [
{
"key" : "<a href="http://user.com" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fuser.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFBbb5wh7mHIIFPQSyIzSea6hjwzQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fuser.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFBbb5wh7mHIIFPQSyIzSea6hjwzQ';return true;">user.com",
"doc_count" : 1
},
{
"key" : "user1",
"doc_count" : 1
}

instead of

"buckets" : [
{
"key" : "<a href="javascript:" target="_blank" gdf-obfuscated-mailto="19vTTkUhq_oJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">us...@...",
"doc_count" : 1
}
]

Same issue persists for string type likes : <a href="http://user1.user2.user.com" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fuser1.user2.user.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFWpL9q7_PQuDf_wK_5PrulpwCUnw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fuser1.user2.user.com\46sa\75D\46sntz\0751\46usg\75AFQjCNFWpL9q7_PQuDf_wK_5PrulpwCUnw';return true;">user1.user2.user.com ,I am doing terms aggregations . Am i missing something here ?


--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/4c3535f6-7fa0-4388-8a81-4ddd26015e92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.