elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
68.58k stars 24.36k forks source link

Term queries with a forward slash in the term do not work as expected #7715

Closed chandra9 closed 9 years ago

chandra9 commented 9 years ago

If I have a document like

{ _index: captora.com _type: contentdiscovery _id: GfUbzwEoTkmnWVO__jzlog _score: 12.953745 _source: { image: http://campaign.com/image1.png subtitle: description: sample description campaign: campaign name title: Title of Campaign assettype: url: http://www.campaign.com } }

and I try a term query with payload like

{ "query": { "term": { "url": "http://www.campaign.com" } }, "from": 0, "size": 9999 }

I get 0 results while the url is exactly as in the document. While a query without http:// in the term returns the document. i.e.

{ "query": { "term": { "url": "www.campaign.com" } }, "from": 0, "size": 9999 }

chandra9 commented 9 years ago

Forgot to mention, the url field is stored and not analyzed.

chandra9 commented 9 years ago

Figured out the problem, we had a client side analyzer in the chain. Thanks! I'll use the forum the next time :tongue: