-
-
Save wizidot/876838 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
curl -XPUT localhost:9200/places -d '{ | |
"settings" : { | |
"index" : { | |
"analysis" : { | |
"default" : { | |
"type" : "custom", | |
"tokenizer" : "whitespace", | |
"filter" : ["standard", "lowercase", "snowball"] | |
}, | |
"motcle":{ | |
"type":"standard", | |
"tokenizer":"keyword", | |
"filter": ["lowercase"] | |
} | |
}, | |
"filter" : { | |
"snowball" : { | |
"type" : "snowball", | |
"language" : "French" | |
} | |
} | |
} | |
}, | |
"mappings": { | |
"place": { | |
"properties": { | |
"CP" : { | |
"type" : "integer", | |
"analyzer" : "motcle", | |
"boost" : "2" | |
}, | |
"VILLE" : { | |
"type" : "string", | |
"store" : "yes", | |
"index" : "analyzed", | |
"boost" : "2" | |
}, | |
"PAYS" : { | |
"type" : "string", | |
"store" : "yes" | |
}, | |
"ADRESSE": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"TEL": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"TELECOPIE": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"EMAIL": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"OPTOUT": { | |
"type":"boolean", | |
"index":"no", | |
"store":"yes", | |
"null_value":"0" | |
}, | |
"WEB": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"CODE_NAF": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"NAME": { | |
"type" : "string", | |
"store" : "yes", | |
"index" : "analyzed", | |
"boost" : "2" | |
}, | |
"LIBELLE_NAF": { | |
"type" : "string", | |
"store" : "yes", | |
"index" : "analyzed", | |
"boost" : "1" | |
}, | |
"location" : { | |
"type" : "geo_point" | |
}, | |
"created": { | |
"type": "date", | |
"format" : "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd", | |
"store": "no" | |
}, | |
"modified": { | |
"type": "date", | |
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd", | |
"store": "no" | |
}, | |
"active":{ | |
"type":"boolean", | |
"index":"no", | |
"store":"yes" | |
}, | |
"LEADID": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"CONTACTID": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"ACCOUNTID": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"SMOWNERID": { | |
"type": "string", | |
"store": "yes", | |
"index": "no" | |
}, | |
"cat1": { | |
"type" : "multi_field", | |
"fields" : { | |
"cat1" : { | |
"omit_term_freq_and_positions" : false, | |
"omit_norms" : false, | |
"store" : "yes", | |
"term_vector" : "no", | |
"type" : "string", | |
"index" : "analyzed", | |
"boost" : 2.3 | |
}, | |
"untouched" : { | |
"omit_term_freq_and_positions" : true, | |
"omit_norms" : true, | |
"store" : "yes", | |
"type" : "string", | |
"term_vector" : "no", | |
"index" : "not_analyzed" | |
} | |
} | |
}, | |
"cat2": { | |
"type" : "multi_field", | |
"fields" : { | |
"cat2" : { | |
"omit_term_freq_and_positions" : false, | |
"omit_norms" : false, | |
"store" : "yes", | |
"term_vector" : "no", | |
"type" : "string", | |
"index" : "analyzed", | |
"boost" : 2.2 | |
}, | |
"untouched" : { | |
"omit_term_freq_and_positions" : true, | |
"omit_norms" : true, | |
"store" : "yes", | |
"type" : "string", | |
"term_vector" : "no", | |
"index" : "not_analyzed" | |
} | |
} | |
}, | |
"cat3": { | |
"type" : "multi_field", | |
"fields" : { | |
"cat3" : { | |
"omit_term_freq_and_positions" : false, | |
"omit_norms" : false, | |
"store" : "yes", | |
"term_vector" : "no", | |
"type" : "string", | |
"index" : "analyzed", | |
"boost" : 2.1 | |
}, | |
"untouched" : { | |
"omit_term_freq_and_positions" : true, | |
"omit_norms" : true, | |
"store" : "yes", | |
"type" : "string", | |
"term_vector" : "no", | |
"index" : "not_analyzed" | |
} | |
} | |
}, | |
"RUBRIQUE_PROFESSIONNELLE": { | |
"type" : "multi_field", | |
"fields" : { | |
"RUBRIQUE_PROFESSIONNELLE" : { | |
"omit_term_freq_and_positions" : false, | |
"omit_norms" : false, | |
"store" : "yes", | |
"term_vector" : "no", | |
"type" : "string", | |
"index" : "analyzed", | |
"boost" : 1 | |
}, | |
"untouched" : { | |
"omit_term_freq_and_positions" : true, | |
"omit_norms" : true, | |
"store" : "yes", | |
"type" : "string", | |
"term_vector" : "no", | |
"index" : "not_analyzed" | |
} | |
} | |
} | |
} | |
} | |
} | |
}' | |
curl -XGET localhost:9200/places/_analyze?text=Banques | |
curl -XPUT 'http://localhost:9200/_bulk' -d '{"create":{"_index":"places","_type":"place"}} | |
{"LEADID":"351877000000091042","SMOWNERID":"351877000000048149","name":"G.B.E Distribution","TEL":"04 75 25 11 40","created":"2011-03-08 17:28:34","modified":"2011-03-08 17:28:34","ADRESSE":"1 rue george bovet","VILLE":"Crest","CP":"26400","cat1":"Banques"} | |
' | |
curl -XPOST localhost:9200/_refresh | |
curl -XGET http://localhost:9200/places/place/_search -d '{"query" : {"field" : {"cat1" : "banque"}}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment