Skip to content

Instantly share code, notes, and snippets.

@mschoch
Created February 21, 2017 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mschoch/60068e94a712d348f8ac445fd71d3e90 to your computer and use it in GitHub Desktop.
Save mschoch/60068e94a712d348f8ac445fd71d3e90 to your computer and use it in GitHub Desktop.
curl -XPUT -H "Content-Type: application/json" \
http://localhost:9200/api/index/custom_index \
-d '{
"type": "fulltext-index",
"name": "custom_index",
"uuid": "3f7fbd72608f0c69",
"sourceType": "couchbase",
"sourceName": "default",
"sourceUUID": "",
"planParams": {
"maxPartitionsPerPIndex": 32,
"numReplicas": 0,
"hierarchyRules": null,
"nodePlanParams": null,
"pindexWeights": null,
"planFrozen": false
},
"params": {
"mapping": {
"analysis": {
"analyzers": {
"customAnalyzer1": {
"char_filters": [
"html"
],
"token_filters": [
"length"
],
"tokenizer": "single",
"type": "custom"
}
},
"char_filters": {
"mapping": {
"regexp": "[f]",
"replace": "ph",
"type": "regexp"
}
},
"token_filters": {
"back_edge_ngram": {
"back": true,
"max": 5,
"min": 3,
"type": "edge_ngram"
},
"dict_compound_en": {
"dict_token_map": "stop_en",
"type": "dict_compound"
},
"dict_compound_fr": {
"dict_token_map": "articles_fr",
"type": "dict_compound"
},
"front_edge_ngram": {
"back": false,
"max": 5,
"min": 3,
"type": "edge_ngram"
},
"keyword_marker": {
"keywords_token_map": "stopwords",
"type": "keyword_marker"
},
"length": {
"max": 5,
"min": 3,
"type": "length"
},
"ngram": {
"max": 5,
"min": 3,
"type": "ngram"
},
"shingle": {
"filler": "",
"max": 5,
"min": 2,
"output_original": "false",
"separator": "",
"type": "shingle"
},
"stopwords": {
"stop_token_map": "stopwords",
"type": "stop_tokens"
},
"truncate": {
"length": 10,
"type": "truncate_token"
}
},
"token_maps": {
"stopwords": {
"tokens": [
"i",
"me",
"my",
"myself",
"we",
"our",
"ours",
"ourselves",
"you",
"your",
"yours",
"yourself",
"yourselves",
"he",
"him",
"his",
"himself",
"she",
"her",
"hers",
"herself",
"it",
"its",
"itself",
"they",
"them",
"their",
"theirs",
"themselves",
"what",
"which",
"who",
"whom",
"this",
"that",
"these",
"those",
"am",
"is",
"are",
"was",
"were",
"be",
"been",
"being",
"have",
"has",
"had",
"having",
"do",
"does",
"did",
"doing",
"would",
"should",
"could",
"ought",
"i'm",
"you're",
"he's",
"she's",
"it's",
"we're",
"they're",
"i've",
"you've",
"we've",
"they've",
"i'd",
"you'd",
"he'd",
"she'd",
"we'd",
"they'd",
"i'll",
"you'll",
"he'll",
"she'll",
"we'll",
"they'll",
"isn't",
"aren't",
"wasn't",
"weren't",
"hasn't",
"haven't",
"hadn't",
"doesn't",
"don't",
"didn't",
"won't",
"wouldn't",
"shan't",
"shouldn't",
"can't",
"cannot",
"couldn't",
"mustn't",
"let's",
"that's",
"who's",
"what's",
"here's",
"there's",
"when's",
"where's",
"why's",
"how's",
"a",
"an",
"the",
"and",
"but",
"if",
"or",
"because",
"as",
"until",
"while",
"of",
"at",
"by",
"for",
"with",
"about",
"against",
"between",
"into",
"through",
"during",
"before",
"after",
"above",
"below",
"to",
"from",
"up",
"down",
"in",
"out",
"on",
"off",
"over",
"under",
"again",
"further",
"then",
"once",
"here",
"there",
"when",
"where",
"why",
"how",
"all",
"any",
"both",
"each",
"few",
"more",
"most",
"other",
"some",
"such",
"no",
"nor",
"not",
"only",
"own",
"same",
"so",
"than",
"too",
"very"
],
"type": "custom"
}
},
"tokenizers": {
"alphanumeric": {
"regexp": "[0-9a-zA-Z_]*",
"type": "regexp"
}
}
},
"default_analyzer": "customAnalyzer1",
"default_datetime_parser": "dateTimeOptional",
"default_field": "_all",
"default_mapping": {
"default_analyzer": "",
"dynamic": true,
"enabled": false
},
"default_type": "_default",
"type_field": "type",
"types": {
"emp": {
"dynamic": false,
"enabled": true,
"fields": [],
"properties": {
"dept": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "customAnalyzer1",
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "dept",
"store": false,
"type": "text"
}
],
"properties": {}
},
"join_date": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "",
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "join_date",
"store": false,
"type": "datetime"
}
],
"properties": {}
},
"languages_known": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "customAnalyzer1",
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "languages_known",
"store": false,
"type": "text"
}
],
"properties": {}
},
"mutated": {
"dynamic": false,
"enabled": true,
"fields": [
{
"analyzer": "",
"include_in_all": true,
"include_term_vectors": true,
"index": true,
"name": "mutated",
"store": false,
"type": "number"
}
],
"properties": {}
}
}
}
}
}
},
"sourceParams": {
"authPassword": "",
"authSaslPassword": "",
"authSaslUser": "",
"authUser": "default",
"clusterManagerBackoffFactor": 0,
"clusterManagerSleepInitMS": 0,
"clusterManagerSleepMaxMS": 20000,
"dataManagerBackoffFactor": 0,
"dataManagerSleepInitMS": 0,
"dataManagerSleepMaxMS": 20000,
"feedBufferAckThreshold": 0,
"feedBufferSizeBytes": 0
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment