Term filter: integer vs string?


(arthurx) #1

I saw that in the term filter doc page
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-terms-filter.html
it shows an example

curl -XPUT localhost:9200/tweets/tweet/1 -d '{
"user" : "2"
}'

here the user id "2" is put as string. In other databases generally one
would use an integer field to represent such id. I wonder is there any
difference in performance (mainly concerning term filter) between string vs
integer?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/5f1db06b-dcf9-44d2-ac04-8fe625f33ade%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Adrien Grand) #2

The way the term filter is executed is the same for strings and integers so
I wouldn't expect any performance difference here.

On Sat, Jan 4, 2014 at 3:34 PM, arthurX fc28222@gmail.com wrote:

I saw that in the term filter doc page

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-terms-filter.html
it shows an example

curl -XPUT localhost:9200/tweets/tweet/1 -d '{
"user" : "2"
}'

here the user id "2" is put as string. In other databases generally one
would use an integer field to represent such id. I wonder is there any
difference in performance (mainly concerning term filter) between string vs
integer?

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/5f1db06b-dcf9-44d2-ac04-8fe625f33ade%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.

--
Adrien Grand

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5SC_ymGiLS253KWzAFT2TLGGAXiWNB8UUexeZuj0Xieg%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3