By default, the standard analyzer breaks a url into several tokens, and
does not keep it as a single token. Since term query is provided with a
term (there is no analysis process on the text) it will not match.
You have two option, either mark the url field in the mapping as "index" :
"not_analyzed", and then the term query will work, or use text query, which
will break the url into several terms on the search side. The second option
does mean that you will also possibly find "non exact" matches.
If you want to combine the two worlds, use multi field mapping (
to have the url analyzed and not analyzed, and then choose on which field
to search based on your use case.
On Thu, Dec 22, 2011 at 2:42 AM, Allan Caffee firstname.lastname@example.org:
I'm having a problem doing a term query for documents that have a literal
match on a string containing a URL. Here's a gist demonstrating the issue:
The query was done on a fresh install of ElasticSearch version 0.18.5.
Any idea what I'm doing wrong here?