Created
          July 3, 2013 19:12 
        
      - 
      
- 
        Save tomasfejfar/5921817 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | dataQuery = { | |
| "query" : { | |
| "custom_filters_score" : { | |
| "query" : { | |
| "match" : { "_all" : query } | |
| }, | |
| "filters" : [ | |
| { | |
| "filter" : { "term" : {"_type" : "ticket"} }, | |
| "boost" : 1.5 | |
| } | |
| ] | |
| } | |
| }, | |
| "facets" : { | |
| "project_id" : { | |
| "terms" : { | |
| "field" : "project_name", | |
| "size" : 10 | |
| } | |
| } | |
| } | |
| }; | |
| if (facet !== undefined) { | |
| console.log(dataQuery); | |
| dataQuery.query.custom_filters_score.filters.push({ | |
| "filter" : { "term" : {"project_name" : facet} }, | |
| "boost" : 10 | |
| }); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment