Skip to content

fvh is not working correctly with match_phrase query with slop. #2637

@cesar-albusac

Description

@cesar-albusac

NEST/Elasticsearch.Net version: 5.0.0

Elasticsearch version: 5.0.0

Description of the problem including expected versus actual behavior: I am trying to highlight some match_phrase queries with slop. With the plain highlight is working fine, but with fvh does not and I don't know why.

Steps to reproduce:

  1. Index some documents.
  2. Do a match_phrase query with slop and using fvh, like this:
 var resultado2 = client.Search<dynamic>(s => s
         .Size(100)
         .Type(Types.Type("text"))
         .Query(q => q.MatchPhrase( mf => mf.Field("textContent").Query(TextToSearch).Slop(8))
             )
         .Highlight(h => h
                .PreTags("<strong style=\"color:#FF4000;\">")
                .PostTags("</strong>")
                .Fields(fs => fs
                    .Field("textContent")
                    .Order("score")
                    .Type(HighlighterType.Fvh)
                    .FragmentSize(150)
                    .NumberOfFragments(3)
                    .NoMatchSize(150)
                    .ForceSource()
                ))


                 )

                 ;
  1. When I see the results, the words are not highlighted.

Provide ConnectionSettings (if relevant):

 client.CreateIndex("documents", c => c
                       .Settings(s => s
                           .NumberOfShards(1)
                           .NumberOfReplicas(1)
                           .Analysis(analysis => analysis
                                .TokenFilters(tf => tf.Stop("stop_es",st => st.StopWords("_spanish_")))
                                .Analyzers(bases => bases
                                    //.Snowball("es_std", es => es.Language(SnowballLanguage.Spanish))
                                    .Custom("analizador_prueba", ca => ca
                                    .Tokenizer("standard")
                                    .Filters("lowercase","stop_es","asciifolding")
                                    
                                    )
                                )
                            )
                       )
                      .Map<texto>(d => d
                           .Properties(p => p
                                   .Text(st => st
                                        .Name(na => na.textContent)
                                        .TermVector(TermVectorOption.WithPositionsOffsets)
                                        .Analyzer("analizador_prueba")
                                   )
                            )
                 )

Provide DebugInformation (if relevant):

Describe the feature:
Is there any problems with the fvh with match_phrase queries with slop?

Metadata

Metadata

Assignees

No one assigned

    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