File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/test/java/fr/pilato/test/elasticsearch/hlclient Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 3131import co .elastic .clients .elasticsearch .cat .ThreadPoolResponse ;
3232import co .elastic .clients .elasticsearch .cluster .PutComponentTemplateResponse ;
3333import co .elastic .clients .elasticsearch .core .*;
34+ import co .elastic .clients .elasticsearch .core .search .HighlightField ;
3435import co .elastic .clients .elasticsearch .ilm .PutLifecycleResponse ;
3536import co .elastic .clients .elasticsearch .indices .*;
3637import co .elastic .clients .elasticsearch .ingest .PutPipelineResponse ;
4344import co .elastic .clients .transport .endpoints .BinaryResponse ;
4445import co .elastic .clients .util .BinaryData ;
4546import co .elastic .clients .util .ContentType ;
47+ import co .elastic .clients .util .NamedValue ;
4648import com .fasterxml .jackson .core .type .TypeReference ;
4749import com .fasterxml .jackson .databind .JsonNode ;
4850import com .fasterxml .jackson .databind .ObjectMapper ;
@@ -328,7 +330,8 @@ void highlight() throws IOException {
328330 final SearchResponse <Void > response = client .search (sr -> sr
329331 .index (indexName )
330332 .query (q -> q .match (mq -> mq .field ("foo" ).query ("bar" )))
331- .highlight (h -> h .fields ("foo" , hf -> hf .maxAnalyzedOffset (10 )))
333+ .highlight (h -> h
334+ .fields (NamedValue .of ("foo" , HighlightField .of (hf -> hf .maxAnalyzedOffset (10 )))))
332335 , Void .class );
333336 assertThat (response .hits ().total ()).isNotNull ();
334337 assertThat (response .hits ().total ().value ()).isEqualTo (1 );
You can’t perform that action at this time.
0 commit comments