Skip to content

Highlight fields Nest 5.0-rc #2362

@justusth

Description

@justusth

Hello, hopefully you wil think this is usefull information: Exception in parsing using Nest to create highligt.

NEST/Elasticsearch.Net version:
5.0-rc

Elasticsearch version:
5.0.0

Description of the problem including expected versus actual behavior:
Step one, search with Highlight containing BoundaryMaxSize set,

Gives:
ServerError = {ServerError: 400Type: parsing_exception Reason: "[highlight] failed to parse field [fields]" CausedBy: "Type: parsing_exception Reason: "[fields] failed to parse field [TestDoc]" CausedBy: "Type: illegal_argument_exception Reason: "[highlight_field] unknow...

Steps to reproduce:
Code example creating said highlight, use highligt in search, set boundarymaxsize:

        var highlight = new Highlight { Fields = new Dictionary<Field, IHighlightField>()};
        foreach (string fieldname in highlightFields.Split(','))
        {
            var f = new Field (GetElasticFieldName(fieldname, type).Value);
            var h = new HighlightField
            {
                Type = HighlighterType.Plain,
                BoundaryMaxSize = 35,
                Field = GetElasticFieldName(fieldname, type).Value,
            };

            highlight.Fields.Add(f, h);
        }

        highlight.PreTags = new List<string> { pretags };
        highlight.PostTags = new List<string> { posttags };

Temporary solution (its ok with me but wasted some time)
Remove BoundaryMaxSize and it works.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions