Hi, I'm creating a index on ECE with a nGram analyzer but never works the query. This is my index:
{
"settings": {
"analysis": {
"analyzer": {
"ailabs_analyzer": {
"type": "stop",
"stopwords": ["a", "an", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with", "any", "than", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t"]
},
"ngram_analyzer": {
"type": "custom",
"tokenizer": "ngram_tokenizer",
"filter":[
"lowercase"
]
}
},
"tokenizer": {
"ngram_tokenizer": {
"type": "nGram",
"min_gram": 3,
"max_gram": 4
}
}
}
},
"mappings": {
"properties": {
"documentId": {
"type": "keyword"
},
"documentName": {
"type": "text",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"documentType": {
"type": "text",
"fields": {
"sortable": {
"type": "keyword"
}
}
},
"dateCreated": {
"type": "keyword"
},
"userCreated": {
"type": "text",
"fields": {
"sortable": {
"type": "keyword"
}
}
},
"language": {
"type": "text",
"fields": {
"sortable": {
"type": "keyword"
}
}
},
"unitOfAnalysis": {
"properties": {
"uoaId": {
"type": "text"
},
"unitOfAnalysis": {
"type": "text",
"analyzer": "ngram_analyzer"
},
"page": {
"type": "integer"
},
"index": {
"type": "integer"
},
"percent": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"duration": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"org": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"date": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"cardinal": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"ordinal": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"gpe": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"person": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"work_of_art": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"time": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"law": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"money": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"loc": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"frequency": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"fac": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"norp": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"quantity": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"language": {
"type": "text",
"analyzer": "ailabs_analyzer",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
}
}
}
}
This is my query
{
"query": {
"query_string" : {
"query" : "unitOfAnalysis.unitOfAnalisys:memb",
"fields" : []
}
}
}
If I search for 'memb' I didn't get results, if I search for 'member' I get 12 results, if I search for members I get 17 results. Any ideas about what I'm doing wrong?