Skip to content

Instantly share code, notes, and snippets.

@wizidot
Created March 18, 2011 22:10
Show Gist options
  • Save wizidot/876945 to your computer and use it in GitHub Desktop.
Save wizidot/876945 to your computer and use it in GitHub Desktop.
my gist
root@www:~# curl -XDELETE 'http://localhost:9200/places/'
{"error":"IndexMissingException[[places] missing]","status":404}root@www:~# ^C
root@www:~# curl -XPUT localhost:9200/places -d '{
> "settings" : {
> "index" : {
> "analysis" : {
> "analyzer" : {
> "default" : {
> "type" : "custom",
> "tokenizer" : "whitespace",
> "filter" : ["standard", "lowercase", "snowball"]
> }
> },
> "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"
> }
> }
> }
> }
> }
> }
> }'
{"error":"ElasticSearchException[Guice creation errors:\n\n1) An exception was caught and reported. Message: Analyzer [filter] must have a type associated with it or a tokenizer\n at org.elasticsearch.common.inject.internal.InjectorShell$Builder.build(InjectorShell.java:132)\n\n1 error]; nested: CreationException[Guice creation errors:\n\n1) An exception was caught and reported. Message: Analyzer [filter] must have a type associated with it or a tokenizer\n at org.elasticsearch.common.inject.internal.InjectorShell$Builder.build(InjectorShell.java:132)\n\n1 error]; nested: ElasticSearchIllegalArgumentException[Analyzer [filter] must have a type associated with it or a tokenizer]; ","status":500}root@www:~# ^C
root@www:~#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment