You can analyze the same processNumber field differently using the fields property in the display:
For example, if you want the analyzed and non-analyzed version of ProcessNumber to be displayed as:
{ "type_name": { "properties": { "processNumber": { "type": "string", "index": "not_analyzed", "fields": { "analyzed": { "type": "string", "index": "analyzed" } } } } } }
If an unanalyzed field is referred to in the request as processNumber .
To refer to the analyzed field type, use processNumber.analyzed
Queries for terms 11/201, 11, etc. will be as follows:
Filter example:
{ "query" : { "filtered" : { "filter" : { "term" : { "processNumber" : "11/2014" } } } } }
The thermal filter does not analyze the search string, so the input will be matched, as with the inverted field index in this case: 11/2014 against the field.
Example Match_Phrase_prefix:
{ "query": { "match_phrase_prefix": { "processNumber": "11/201" } } }
match_phrase_prefix tries to check if the last term in a phrase is a prefix of terms in the index. It parses the search string if an parser is specified. It is for this reason that you need to use an unanalyzable version of the field here. If we use processNumber. The analyzed search queries, such as 11-201, 11 | 201 will also match
match example:
{ "query": { "match": { "processNumber.analyzed": "11" } } }
This is a direct match expression, since the default parser (usually a standard parser) will tokenize 11/2014 to condition 11, 2014.
You can use api analysis to see how specific text is analyzed by default.
curl -XPOST "http://<machine>/_analyze?text=11/2014"