Created
          December 30, 2014 09:11 
        
      - 
      
 - 
        
Save jprante/85126685973311603c8a to your computer and use it in GitHub Desktop.  
    multi_match and boost
  
        
  
    
      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
    
  
  
    
  | curl -XDELETE 'localhost:9200/test' | |
| curl -XPUT 'localhost:9200/test' | |
| curl -XPUT 'localhost:9200/test/test/_mapping' -d ' | |
| { | |
| "test": { | |
| "properties": { | |
| "custom_all":{ | |
| "type": "string" | |
| }, | |
| "name":{ | |
| "type": "string" | |
| }, | |
| "surName":{ | |
| "type": "string" | |
| }, | |
| "dateRecorded":{ | |
| "type": "date" | |
| }, | |
| "Id":{ | |
| "type": "long" | |
| } | |
| } | |
| } | |
| } | |
| ' | |
| curl -XGET 'localhost:9200/test/_mapping' | |
| curl -XPUT 'localhost:9200/test/test/1' -d ' | |
| { | |
| "surName" : "Preeti" | |
| } | |
| ' | |
| curl -XPUT 'localhost:9200/test/test/2' -d ' | |
| { | |
| "name" : "Preeti" | |
| } | |
| ' | |
| curl -XGET 'localhost:9200/test/_refresh' | |
| curl -XGET 'localhost:9200/test/_search?pretty' -d ' | |
| { | |
| "query": { | |
| "multi_match": { | |
| "query" : "Preeti", | |
| "fields" : [ "name^2", "surName" ] | |
| } | |
| } | |
| } | |
| ' | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment