Hello community,
I'm having problem understanding how analyzer should work. The result is
different from what I expect.
I have created a custom analyzer to index phone number as below:
"analysis" : {
"analyzer" : {
"phone" : {
"type": "custom",
"tokenizer":"phone_tokenizer",
"filter" : [ "phone_filter", "unique" ]
}
},
"tokenizer" : {
"phone_tokenizer" : {
"type" : "pattern",
"pattern":"\\s*[a-zA-Z]+\\s*"
}
},
"filter" : {
"phone_filter" : {
"type" : "word_delimiter",
"preserve_original" : 1,
"generate_number_parts" : 1,
"catenate_numbers" : 1
}
}
}
The intention is to match:
Query Input:
1112223333, 111.222.3333, 111-222-3333, or 111 222 3333, (111)2223333,
1-(111)-222-3333, etc.
With records containing phone number such as:
111.222.3333, 111-222-3333, or 111 222 3333, (111)2223333,
1-(111)-222-3333, etc.
So with search input: (111)2223333 with queryType "matchPhraseQuery", I
thought the query will return the records with phone number such as
111.222.3333, 111-222-3333, etc. because input (111)2223333 would be
analyzed into 1112223333, 111, and 2223333.
Given I have specified "catenate_numbers" in filter for my "phone"
analyzer, I would expect that numbers the numbers that meets the following
condition will be matched:
Match numbers that are indexed as ( 111 AND 2223333 ) OR 1112223333.
But result is no match.
Is my understanding incorrect? With search input (111)2223333 using
matchPhraseQuery, I thought it will match all numbers that has 1112223333
as the concatenated value but it seems to match only with numbers whose
number parts are 111 and 2223333...
Your feedback/help/input is greatly appreciated!!
Best regards
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b0658b33-2efb-495a-8090-7cc12806a253%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.