When words are searched with "" (Double quotes), it's actually happening partial search. My expection is string wrapped with double quotes should match exact words and highlight with the word searched.
Content - ( For reference only)
Routing is the process of selecting a path for traffic in a network. The routing process usually directs forwarding on the basis of routing-tables. Structured addresses allow a single routing table entry to represent the route to a group of devices. Using this map, each router independently determines the least-cost path ...
Text Search - "route"
Current Results - It's matching "router" , "routing" , "routes", "routing-table", "ES(config-router)" along with "route"
Expected Output match should be - "route" text should only be matched and it should not match other words.
Used "Ingest Attachment Processor Plugin" for extracting html files and indexed into elastic search.
https://www.elastic.co/guide/en/elasticsearch/plugins/5.2/ingest-attachment.html
PUT my_index/_mapping/storage
{
"properties": {
"content": {
"include_in_all": true,
"analyzer": "match_phrase",
"term_vector": "with_positions_offsets",
"type": "text",
"fields": {
"ngrammed": {
"term_vector": "with_positions_offsets",
"type": "text"
}
}
}
},
"meta": {
"properties": {
"pageNumber": {
"type": "long"
},
"src": {
"norms": {
"enabled": false
},
"analyzer": "lowercase_keyword",
"type": "text"
}
}
}
}
Search Query -
{
"_source": [
"meta.pageNumber"
],
"query": {
"bool": {
"must": [
{
"constant_score": {
"query": {
"query_string": {
"query": "\"route\""
}
},
"boost": 5
}
},
{
"query_string": {
"default_field": "content.ngrammed",
"query": "\"route\""
}
}
],
"filter": {
"term": {
"meta.src": "456"
}
}
}
},
"highlight": {
"require_field_match": true,
"fields": {
"content.ngrammed": {}
},
"fragment_size": 100,
"number_of_fragments": 3
},
"sort": {
"meta.pageNumber": {
"order": "asc"
}
},
"from": 0,
"size": "15"
}
Any help or guide from Elastic Team will be really helpful to solve it.