Elasticsearch term facet not showing negative terms

I am using elastic search term facets, My field contains some negative
values but the facet is ignoring the negative sign

following is the facet query

http://myserver.com:9200/index/type/_search

Get/Post body

{
"facets" : {
"school.id" : {
"terms" : {
"field" : "school.id",
"size" : 10
}
}
}
}

Response

{
"took": 281,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"facets": {
"school.id": {
"_type": "terms",
"missing": 302,
"total": 4390,
"other": 0,
"terms": [
{
"term": "1113515007867355135",
"count": 4390
}
]
}
}
}

The actual value of id is -1113515007867355135, am I doing something
wrong or do I need to pass anything to include negative sign (stemming
issue)?

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Have a look at how ES analyzed your field.

curl -XGET 'localhost:9200/_analyze?analyzer=standard&pretty' -d '-1113515007867355135'
{
"tokens" : [ {
"token" : "1113515007867355135",
"start_offset" : 1,
"end_offset" : 20,
"type" : "",
"position" : 1
} ]
}

You should modify your mapping for this field and use for example a keyword analyzer
curl -XGET 'localhost:9200/_analyze?analyzer=keyword&pretty' -d '-1113515007867355135'
{
"tokens" : [ {
"token" : "-1113515007867355135",
"start_offset" : 0,
"end_offset" : 20,
"type" : "word",
"position" : 1
} ]
}

HTH

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 26 mars 2013 à 19:08, Maaz Bin Tariq maaz786@gmail.com a écrit :

I am using elastic search term facets, My field contains some negative values but the facet is ignoring the negative sign

following is the facet query

http://myserver.com:9200/index/type/_search

Get/Post body

{
"facets" : {
"school.id" : {
"terms" : {
"field" : "school.id",
"size" : 10
}
}
}
}
Response

{
"took": 281,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"facets": {
"school.id": {
"_type": "terms",
"missing": 302,
"total": 4390,
"other": 0,
"terms": [
{
"term": "1113515007867355135",
"count": 4390
}
]
}
}
}
The actual value of id is -1113515007867355135, am I doing something wrong or do I need to pass anything to include negative sign (stemming issue)?

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Yes.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 27 mars 2013 à 06:48, Maaz Bin Tariq maaz786@gmail.com a écrit :

Thanks, but does it require reindexing all data as well?

On Tue, Mar 26, 2013 at 11:14 PM, David Pilato david@pilato.fr wrote:

Have a look at how ES analyzed your field.

curl -XGET 'localhost:9200/_analyze?analyzer=standard&pretty' -d '-1113515007867355135'
{
"tokens" : [ {
"token" : "1113515007867355135",
"start_offset" : 1,
"end_offset" : 20,
"type" : "",
"position" : 1
} ]
}

You should modify your mapping for this field and use for example a keyword analyzer
curl -XGET 'localhost:9200/_analyze?analyzer=keyword&pretty' -d '-1113515007867355135'
{
"tokens" : [ {
"token" : "-1113515007867355135",
"start_offset" : 0,
"end_offset" : 20,
"type" : "word",
"position" : 1
} ]
}

HTH

David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 26 mars 2013 à 19:08, Maaz Bin Tariq maaz786@gmail.com a écrit :

I am using elastic search term facets, My field contains some negative values but the facet is ignoring the negative sign

following is the facet query

http://myserver.com:9200/index/type/_search

Get/Post body

{
"facets" : {
"school.id" : {
"terms" : {
"field" : "school.id",
"size" : 10
}
}
}
}
Response

{
"took": 281,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"facets": {
"school.id": {
"_type": "terms",
"missing": 302,
"total": 4390,
"other": 0,
"terms": [
{
"term": "1113515007867355135",
"count": 4390
}
]
}
}
}
The actual value of id is -1113515007867355135, am I doing something wrong or do I need to pass anything to include negative sign (stemming issue)?

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

For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elasticsearch/FeObbeT1eok/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.