Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL Search, What is the difference between colon and equal?

I found that Elasticsearch returns the same results for following queries.

twitter/_search?q=user:kimchy

twitter/_search?q=user=kimchy

However, If I query for nested object, Elasticsearch will return different results

twitter/_search?q=location.address:us

twitter/_search?q=location.address=us

What do colon and equal mean in term of Elasticsearch?

like image 831
Tran Thien Chien Avatar asked Oct 20 '25 06:10

Tran Thien Chien


1 Answers

The = sign is part of the URL to separate the parameter and values in the query string.

The : sign is part of the Lucene query expression language and is always used in the q= parameter of the query string.

So the first queries above are correct but not the second ones, even though they return data.

like image 116
Val Avatar answered Oct 22 '25 03:10

Val