Skip to content

Commit

Permalink
trying out some fuzzy action for #40
Browse files Browse the repository at this point in the history
  • Loading branch information
brozeph committed May 28, 2015
1 parent 6f74666 commit d27a2b3
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions lib/data/postings.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,27 @@ module.exports = function (app, es, self) {
self.aggregateByCategory = function (searchTerms, callback) {
var
query = {
aggs: {
aggs : {
'group_by_categoryCode': {
terms: {
field: 'categoryCode'
terms : {
field : 'categoryCode'
}
}
},
query: {
match: {
heading: searchTerms
/*
// single field non-fuzzy match
query : {
match : {
heading : searchTerms
}
}
//*/
// multi-field fuzzy match
query : {
'multi_match' : {
fields : ['heading', 'body'],
fuzziness : 'AUTO',
query : searchTerms
}
}
},
Expand Down

0 comments on commit d27a2b3

Please sign in to comment.