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: https://gist.github.com/1508383
The query was done on a fresh install of ElasticSearch version 0.18.5. Any
idea what I'm doing wrong here?
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.