Hi, I am new to Elasticsearch and have tried out creating index with Fscrawler. After creating custom Analyzers, when i try to search on the fields"content.phonetic" and "content.shingle", i do not get a search hit. Can someone please guide me to where i am going wrong.
The _settings.json file used in Fscrawler is given below
//MY CODE
{
"settings": {
"index.mapping.total_fields.limit": 2000,
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "standard",
"filter": ["lowercase","custom_edge_ngram"]
},
"dbl_metaphone":{
"type": "custom",
"tokenizer": "standard",
"filter": ["dbl_metaphone"]
},
"shingle":{
"type": "custom",
"tokenizer": "standard",
"filter": ["shingle-filter"]
}
},
"filter": {
"custom_edge_ngram": {
"type": "edge_ngram",
"min_gram": 2,
"max_gram": 10
},
"dbl_metaphone": {
"type": "phonetic",
"encoder": "double_metaphone"
},
"shingle-filter": {
"max_shingle_size": "5",
"min_shingle_size": "2",
"output_unigrams": "false",
"type": "shingle"
}
}}}},}
},
"mappings": {
"_doc": {
"dynamic_templates": [
{
"raw_as_text": {
"path_match": "meta.raw.*",
"mapping": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
} } } } } ],
"properties": {
"attachment": {
"type": "binary",
"doc_values": false
},
"attributes": {
"properties": {
"group": {
"type": "keyword"
},
"owner": {
"type": "keyword"
}
}
},
"content": {
"type": "text"
"index_analyzer": "default",
"search_analyzer" : "standard",
"fields:{
"phonetic":{
"type":"text",
"analyzer":"dbl_metaphone"
},
"shingle":{
"type":"text",
"analyzer":"shingle"
}
}
},
code continues ----------------------------------
-----ADDING DOCUMENT TO TEST INDEX--------
POST /test/_doc
{
"content": "Learning Elastic Stack 6"
}
TRYING TO SEARCH ON INDEX----->No result on "content.phonetic" and "content.shingle" but result obtained on the field "content".
GET /test/_search
{
"query": {
"multi_match": {
"query": "learning",
"fields": ["content.phonetic"]
}
}
}