Created
August 2, 2012 10:12
-
-
Save anonymous/3236078 to your computer and use it in GitHub Desktop.
ElasticSearch boost/not_analyzed problem
This file contains 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 'http://localhost:9200/myindex' | |
curl -XPOST 'http://localhost:9200/myindex' | |
curl -XPOST 'http://localhost:9200/_refresh' | |
curl -XPUT 'http://localhost:9200/myindex/author/_mapping' -d '{ | |
"author": { | |
"properties": { | |
"id": { | |
"type": "long" | |
}, | |
"boostFactor": { | |
"type": "float", | |
"null_value": 1.0 | |
}, | |
"name": { | |
"type": "string", | |
"index": "not_analyzed" | |
}, | |
"countryOfBirth": { | |
"type": "string" | |
} | |
} | |
} | |
}' | |
curl -XPUT 'http://localhost:9200/myindex/author/1' -d '{ | |
"id": 1, | |
"boostFactor": 0.22, | |
"name": "SewaldKruse", | |
"countryOfBirth": "Deutschland" | |
}' | |
curl -XPUT 'http://localhost:9200/myindex/author/2' -d '{ | |
"id": 2, | |
"boostFactor": 0.61, | |
"name": "SergioHerold", | |
"countryOfBirth": "Peru" | |
}' | |
curl -XPUT 'http://localhost:9200/myindex/author/3' -d '{ | |
"id": 3, | |
"boostFactor": 0.07, | |
"name": "GudrunWeil", | |
"countryOfBirth": "Serbien" | |
}' | |
curl -XPOST 'http://localhost:9200/_refresh' | |
echo | |
echo | |
echo QUERY_STRING | |
curl -XGET 'http://localhost:9200/myindex/author/_search?pretty=true' -d '{ | |
"query": { | |
"query_string": { | |
"query": "name:(se*)^20 se*" | |
} | |
} | |
}' | |
echo | |
echo | |
echo MAPPING : | |
curl -XGET 'http://localhost:9200/myindex/author/_mapping?pretty=true' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment