Skip to content

Commit

Permalink
Closes #653.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Nov 4, 2013
1 parent 90d765d commit ff98f46
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/services/querySrv.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@ function (angular, _, config, kbn) {
)))).size(0);

var results = request.doSearch();
// Like the regex and lucene queries, this returns a promise
return results.then(function(data) {
var _colors = kbn.colorSteps(q.color,data.facets.query.terms.length);
var i = -1;
return _.map(data.facets.query.terms,function(t) {
++i;
return self.defaults({
query : q.field+':"'+t.term+'"'+suffix,
query : q.field+':"'+kbn.addslashes(t.term)+'"'+suffix,

This comment has been minimized.

Copy link
@rashidkpc

rashidkpc Nov 4, 2013

Contributor

Since we use a quoted string for the term we only need to escape " and \

alias : t.term + (q.alias ? " ("+q.alias+")" : ""),
type : 'lucene',
color : _colors[i],
Expand Down Expand Up @@ -143,7 +144,8 @@ function (angular, _, config, kbn) {
}
};

// This is used both for adding queries and modifying them. If an id is passed, the query at that id is updated
// This is used both for adding queries and modifying them. If an id is passed,
// the query at that id is updated
this.set = function(query,id) {
if(!_.isUndefined(id)) {
if(!_.isUndefined(self.list[id])) {
Expand Down Expand Up @@ -185,8 +187,8 @@ function (angular, _, config, kbn) {
}
};

// In the case of a compound query, such as a derived query, we'd need to
// return an array of elasticJS objects. Not sure if that is appropriate?

// These are the only query types that can be returned by a compound query.
this.toEjsObj = function (q) {
switch(q.type)
{
Expand Down

0 comments on commit ff98f46

Please sign in to comment.