title: Defining analyzer while querying in elasticSearch
body: <p>I am pretty new to elasticsearch and just need some clarification:
  Can we define a analyzer while querying the search server. I tried it with the "text" and "field" query and it works fine:</p>
  
  <p>Query:</p>
  
  <pre><code>curl -XPOST http://localhost:9200/test/user/_search? -d '{ "query" : {
  "text" : {"_all" : {"query" :"Vaibhav","analyzer" :
  "lowercase_keyword" }} } }'
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>{"took":144,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":1,"max_score":0.10848885,"hits":{"_index":"test","_type":"user","_id":"1","_score":0.10848885,
  "_source" : {
     "first_name": "Vaibhav",
     "last_name":"saini",
     "password":"pwd"
  </code></pre>
  
  <p>But when I try to do the same thing with term/prefix/wildcard query I get the exception:</p>
  
  <p>Query: </p>
  
  <pre><code>curl -XPOST http://localhost:9200/test/user/_search? -d '{
  "query" : { "term" : {"_all" : {"query" :"Vaibhav","analyzer" :
  "lowercase_keyword" }} } }'
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>{"error":"SearchPhaseExecutionException[Failed to execute phase [query], total failure; shardFailures
  {[kws9J6tbQtWCMNKBm3Gpkw][test][4]: SearchParseException[[test][4]:
  from[-1],size[-1]: Parse Failure [Failed to parse source
  [\n{\n\"query\" : {\n\"term\" : {\"_all\" : {\"query\"
  :\"Vaibhav\",\"analyzer\" : \"lowercase_keyword\" }}\n}\n}]]]; nested:
  QueryParsingException[[test] [term] query does not support [query]];
  }{[kws9J6tbQtWCMNKBm3Gpkw][test][1]: SearchParseException[[test][1]:
  from[-1],size[-1]: Parse Failure [Failed to parse source
  [\n{\n\"query\" : {\n\"term\" : {\"_all\" : {\"query\"
  :\"Vaibhav\",\"analyzer\" : \"lowercase_keyword\" }}\n}\n}]]]; nested:
  QueryParsingException[[test] [term] query does not support [query]];
  }{[kws9J6tbQtWCMNKBm3Gpkw][test][2]: SearchParseException[[test][2]:
  from[-1],size[-1]: Parse Failure [Failed to parse source
  [\n{\n\"query\" : {\n\"term\" : {\"_all\" : {\"query\"
  :\"Vaibhav\",\"analyzer\" : \"lowercase_keyword\" }}\n}\n}]]]; nested:
  QueryParsingException[[test] [term] query does not support [query]];
  }]","status":500}
  </code></pre>
  
  <p>So is it like we can't define analayzers while querying the elasticsearch server for some type of queries and for others we can? If not, am I doing anything wrong?</p>
  
  <p>Any help is greatly appreciated.</p>