Solved: fragCharSize(0) is too small. It must be 18 or higher

Hi there,

I needed to resolve a bug with "plain" highlighter (very same like here: Highlighter trim a field, why?)
My use case:
"plain" highlighter returned "United States (USA" instead of "United States (USA)", no_match_size is 1000.
"plain" highlighter was also not able to highlight exact match (in one <em> tag).

So, I realized to use "fvh" highlighter. It worked well with normal query
Mapping:
...
"LOSS_LOCATION":{
"type":"text",
"term_vector":"with_positions_offsets"
}
...

Highlighting:
"query": {
"query_string": {
"default_field": "content.LOSS_LOCATION",
"query": ""United States""
}
},
"highlight": {
"fields": {
"content.LOSS_LOCATION": {
"fragment_size": 0,
"number_of_fragments": 0,
"no_match_size":1000,
"type":"fvh"
}
}
}

Response:
....
"highlight": {
"content.LOSS_LOCATION": [
"<em>United States</em> (USA)"
]
}

But, once I used Query template, I obtained follwing error:

fragCharSize(0) is too small. It must be 18 or higher.

Do anyone knows, what could be the rootcause? How to handle this?

Thanks in advance

Ok, I found the problem by myself.
One of attribute in highlighting had:

"fragment_size": 0

I changed this to higher value and it works well

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.