I have an indexed field named "searchBucket" with the term "#revit" in it. Here is the analyzer applied to that field:
"default" : {
"filter" : [
"lowercase",
"asciifolding",
"english_stopwords_filter",
"minimal_english_stemmer"
],
"char_filter" : "html_strip",
"type" : "custom",
"tokenizer" : "uax_url_email"
}
Via the Analyze API I've confirmed that this is the token that is generated:
{
"tokens" : [
{
"token" : "revit",
"start_offset" : 1,
"end_offset" : 6,
"type" : "<ALPHANUM>",
"position" : 0
}
]
}
I'm trying to search this field using the Simple Query String Query as follows:
"simple_query_string": {
"default_operator": "and",
"fields": ["searchBucket"],
"flags": "AND|OR|NOT|PREFIX|PHRASE|PRECEDENCE|WHITESPACE|FUZZY",
"fuzzy_prefix_length": 1,
"fuzzy_transpositions": true,
"lenient": true,
"query": "#reivt~",
"quote_field_suffix": ".exact"
}
As you can see, I'm trying to run a fuzzy query where the "i" and "v" are transposed. This does not match. However, if I remove the "#" from the beginning of the query and search "reivt~" it does match. Also if I remove the tilde from the query and search "#revit" it matches.
So it seems like perhaps using the tilde (fuzzy query) means that the field's analyzer isn't being applied? Is there anyone that can confirm this? Or can anyone give me a way to get the lucene query that is being generated under the hood for the simple query string query?