I am using AngularJS and ElasticJS for querying Elasticsearch.
For the normal query given below, I have been able to write the 
corresponding script provided below the query

QUERY

{
   "query": {
      "match": {
         "_all": {
            "query": "India Delhi",
            "operator": "and"
         }
      }
   }
}


SCRIPT

myServices.factory('searchService', ['es',  function(es) {
  return {
    textSearch: function(query){
      return es.search({
        index: 'country',
        type: 'state',
        q: query,
defaultOperator: 'AND'
      })
    }
  };
}]);


Now I have written a query_string that works over multiple queries

{
   "size": 10,
   "query": {
"query_string" : {
    "query":    "India Delhi", 
    "fields": [ "Country","State",  "City" ] ,
"default_operator": "AND"

}
}
}

How to represent the above query in javascript function ?

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/753c6687-3d91-4084-809c-5bbf034b12ac%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to