diff --git a/server/src/main/java/org/elasticsearch/index/mapper/InferenceMetadataFieldsMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/InferenceMetadataFieldsMapper.java index 5924c42101c69..57b59aac7fbeb 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/InferenceMetadataFieldsMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/InferenceMetadataFieldsMapper.java @@ -12,10 +12,16 @@ import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.join.BitSetProducer; +import org.elasticsearch.index.query.SearchExecutionContext; import java.util.Map; import java.util.function.Function; +/** + * An abstract {@link MetadataFieldMapper} used as a placeholder for implementation + * in the inference module. It is required by {@link SourceFieldMapper} to identify + * the field name for removal from _source. + */ public abstract class InferenceMetadataFieldsMapper extends MetadataFieldMapper { public static final String NAME = "_inference_fields"; public static final String CONTENT_TYPE = "_inference_fields"; @@ -39,6 +45,9 @@ public InferenceMetadataFieldType() { super(NAME, false, false, false, TextSearchInfo.NONE, Map.of()); } + /** + * Returns a {@link ValueFetcher} without requiring the construction of a full {@link SearchExecutionContext}. + */ public abstract ValueFetcher valueFetcher( MappingLookup mappingLookup, Function bitSetCache, diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/highlight/SemanticTextHighlighter.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/highlight/SemanticTextHighlighter.java index 3b04ca3d91ee2..a18fbb6374e92 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/highlight/SemanticTextHighlighter.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/highlight/SemanticTextHighlighter.java @@ -46,6 +46,11 @@ import java.util.List; import java.util.Map; +/** + * A {@link Highlighter} designed for the {@link SemanticTextFieldMapper}. + * It extracts semantic queries and compares them against each chunk in the document. + * The top-scoring chunks are returned as snippets, sorted by their scores. + */ public class SemanticTextHighlighter implements Highlighter { public static final String NAME = "semantic"; @@ -54,6 +59,7 @@ private record OffsetAndScore(OffsetSourceFieldMapper.OffsetSource offset, float @Override public boolean canHighlight(MappedFieldType fieldType) { if (fieldType instanceof SemanticTextFieldMapper.SemanticTextFieldType semanticTextFieldType) { + // TODO: Handle semantic text field prior to the inference metadata fields version. return semanticTextFieldType.getIndexVersionCreated().onOrAfter(IndexVersions.INFERENCE_METADATA_FIELDS); } return false; diff --git a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/highlight/SemanticTextHighlighterTests.java b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/highlight/SemanticTextHighlighterTests.java index 73d7f2b41b05a..d83d33e8e3adb 100644 --- a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/highlight/SemanticTextHighlighterTests.java +++ b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/highlight/SemanticTextHighlighterTests.java @@ -18,12 +18,11 @@ import org.apache.lucene.tests.index.RandomIndexWriter; import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.search.SearchRequest; -import org.elasticsearch.common.Strings; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.index.IndexVersion; -import org.elasticsearch.index.mapper.DocumentMapper; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.MapperServiceTestCase; import org.elasticsearch.index.mapper.SourceToParse; @@ -49,6 +48,7 @@ import org.junit.Before; import org.mockito.Mockito; +import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.HashMap; @@ -59,38 +59,7 @@ import static org.mockito.Mockito.mock; public class SemanticTextHighlighterTests extends MapperServiceTestCase { - private MapperService mapperService; - private DocumentMapper documentMapper; - - private static final String MAPPINGS = """ - { - "_doc": { - "properties": { - "field": { - "type": "text", - "copy_to": ["sparse_field", "dense_field"] - }, - "sparse_field": { - "type": "semantic_text", - "inference_id": ".elser-2-elasticsearch", - "model_settings": { - "task_type": "sparse_embedding" - } - }, - "dense_field": { - "type": "semantic_text", - "inference_id": ".multilingual-e5-small-elasticsearch", - "model_settings": { - "task_type": "text_embedding", - "dimensions": 384, - "similarity": "cosine", - "element_type": "float" - } - } - } - } - } - """; + private Map queries; @Override protected Collection getPlugins() { @@ -101,14 +70,61 @@ protected Collection getPlugins() { @Before public void setUp() throws Exception { super.setUp(); - mapperService = createMapperService(MAPPINGS); - documentMapper = mapperService.documentMapper(); + queries = XContentHelper.convertToMap( + Streams.readFully(SemanticTextHighlighterTests.class.getResourceAsStream("queries.json")), + false, + XContentType.JSON + ).v2(); + } + + public void testDenseVector() throws Exception { + var mapperService = createDefaultMapperService(); + float[] vector = readDenseVector(queries.get("dense_vector_1")); + var fieldType = (SemanticTextFieldMapper.SemanticTextFieldType) mapperService.mappingLookup().getFieldType("dense_field"); + KnnVectorQueryBuilder knnQuery = new KnnVectorQueryBuilder(fieldType.getEmbeddingsField().fullPath(), vector, 10, 10, null); + NestedQueryBuilder nestedQueryBuilder = new NestedQueryBuilder(fieldType.getChunksField().fullPath(), knnQuery, ScoreMode.Max); + var shardRequest = createShardSearchRequest(nestedQueryBuilder); + var sourceToParse = new SourceToParse( + "0", + Streams.readFully(SemanticTextHighlighterTests.class.getResourceAsStream("sample-doc.json")), + XContentType.JSON + ); + + assertHighlightOneDoc(mapperService, shardRequest, sourceToParse, "dense_field", 1, new String[] { "" }); } - private void assertHighlightOneDoc(ShardSearchRequest request, SourceToParse source, String fieldName, String[] expectedPassages) - throws Exception { + private MapperService createDefaultMapperService() throws IOException { + return createMapperService( + Streams.readFully(SemanticTextHighlighterTests.class.getResourceAsStream("mappings.json")).utf8ToString() + ); + } + + private float[] readDenseVector(Object value) { + if (value instanceof List lst) { + float[] res = new float[lst.size()]; + int pos = 0; + for (var obj : lst) { + if (obj instanceof Number number) { + res[pos++] = number.floatValue(); + } else { + throw new IllegalArgumentException("Expected number, got " + obj.getClass().getSimpleName()); + } + } + return res; + } + throw new IllegalArgumentException("Expected list, got " + value.getClass().getSimpleName()); + } + + private void assertHighlightOneDoc( + MapperService mapperService, + ShardSearchRequest request, + SourceToParse source, + String fieldName, + int numFragments, + String[] expectedPassages + ) throws Exception { SemanticTextFieldMapper fieldMapper = (SemanticTextFieldMapper) mapperService.mappingLookup().getMapper(fieldName); - var doc = documentMapper.parse(source); + var doc = mapperService.documentMapper().parse(source); assertNull(doc.dynamicMappingsUpdate()); try (Directory dir = newDirectory()) { IndexWriterConfig iwc = newIndexWriterConfig(new StandardAnalyzer()); @@ -137,7 +153,9 @@ private void assertHighlightOneDoc(ShardSearchRequest request, SourceToParse sou new RankDoc(docID, Float.NaN, 0) ); try { - var highlightContext = new HighlightBuilder().field(fieldName, 512, 1).highlighterType("semantic").build(execContext); + var highlightContext = new HighlightBuilder().field(fieldName, 0, numFragments) + .highlighterType("semantic") + .build(execContext); for (var fieldContext : highlightContext.fields()) { FieldHighlightContext context = new FieldHighlightContext( @@ -150,7 +168,10 @@ private void assertHighlightOneDoc(ShardSearchRequest request, SourceToParse sou new HashMap<>() ); var result = highlighter.highlight(context); - System.out.println(Strings.toString(result, true, true)); + assertThat(result.fragments().length, equalTo(expectedPassages.length)); + for (int i = 0; i < result.fragments().length; i++) { + assertThat(result.fragments()[i].string(), equalTo(expectedPassages[i])); + } } } finally { hitContext.hit().decRef(); @@ -171,401 +192,4 @@ private ShardSearchRequest createShardSearchRequest(QueryBuilder queryBuilder) { SearchRequest request = createSearchRequest(queryBuilder); return new ShardSearchRequest(OriginalIndices.NONE, request, new ShardId("index", "index", 0), 0, 1, AliasFilter.EMPTY, 1, 0, null); } - - public void testDenseVector() throws Exception { - float[] vector = new float[] { - 0.09475211f, - 0.044564713f, - -0.04378501f, - -0.07908551f, - 0.04332011f, - -0.03891992f, - -0.0062305215f, - 0.024245035f, - -0.008976331f, - 0.032832284f, - 0.052760173f, - 0.008123907f, - 0.09049037f, - -0.01637332f, - -0.054353267f, - 0.00771307f, - 0.08545496f, - -0.079716265f, - -0.045666866f, - -0.04369993f, - 0.009189822f, - -0.013782891f, - -0.07701858f, - 0.037278354f, - 0.049807206f, - 0.078036495f, - -0.059533164f, - 0.051413406f, - 0.040234447f, - -0.038139492f, - -0.085189626f, - -0.045546446f, - 0.0544375f, - -0.05604156f, - 0.057408098f, - 0.041913517f, - -0.037348013f, - -0.025998272f, - 0.08486864f, - -0.046678443f, - 0.0041820924f, - 0.007514462f, - 0.06424746f, - 0.044233218f, - 0.103267275f, - 0.014130771f, - -0.049954403f, - 0.04226959f, - -0.08346965f, - -0.01639249f, - -0.060537644f, - 0.04546336f, - 0.012866155f, - 0.05375096f, - 0.036775924f, - -0.0762226f, - -0.037304543f, - -0.05692274f, - -0.055807598f, - 0.0040082196f, - 0.059259634f, - 0.012022011f, - -8.0863154E-4f, - 0.0070405705f, - 0.050255686f, - 0.06810016f, - 0.017190414f, - 0.051975194f, - -0.051436286f, - 0.023408439f, - -0.029802637f, - 0.034137156f, - -0.004660689f, - -0.0442122f, - 0.019065322f, - 0.030806554f, - 0.0064652697f, - -0.066789865f, - 0.057111286f, - 0.009412479f, - -0.041444767f, - -0.06807582f, - -0.085881524f, - 0.04901128f, - -0.047871742f, - 0.06328623f, - 0.040418074f, - -0.081432894f, - 0.058384005f, - 0.006206527f, - 0.045801315f, - 0.037274595f, - -0.054337103f, - -0.06755516f, - -0.07396888f, - -0.043732334f, - -0.052053086f, - 0.03210978f, - 0.048101492f, - -0.083828256f, - 0.05205026f, - -0.048474856f, - 0.029116616f, - -0.10924888f, - 0.003796487f, - 0.030567763f, - 0.026949523f, - -0.052353345f, - 0.043198872f, - -0.09456988f, - -0.05711594f, - -2.2292069E-4f, - 0.032972734f, - 0.054394923f, - -0.0767535f, - -0.02710579f, - -0.032135617f, - -0.01732382f, - 0.059442326f, - -0.07686165f, - 0.07104082f, - -0.03090021f, - -0.05450075f, - -0.038997203f, - -0.07045443f, - 0.00483161f, - 0.010933604f, - 0.020874644f, - 0.037941266f, - 0.019729063f, - 0.06178368f, - 0.013503478f, - -0.008584046f, - 0.045592044f, - 0.05528768f, - 0.11568184f, - 0.0041300594f, - 0.015404516f, - -3.8067883E-4f, - -0.06365399f, - -0.07826643f, - 0.061575573f, - -0.060548335f, - 0.05706082f, - 0.042301804f, - 0.052173313f, - 0.07193179f, - -0.03839231f, - 0.0734415f, - -0.045380164f, - 0.02832276f, - 0.003745178f, - 0.058844633f, - 0.04307504f, - 0.037800383f, - -0.031050054f, - -0.06856359f, - -0.059114788f, - -0.02148857f, - 0.07854358f, - -0.03253363f, - -0.04566468f, - -0.019933948f, - -0.057993464f, - -0.08677458f, - -0.06626883f, - 0.031657256f, - 0.101128764f, - -0.08050056f, - -0.050226066f, - -0.014335166f, - 0.050344367f, - -0.06851419f, - 0.008698909f, - -0.011893435f, - 0.07741272f, - -0.059579294f, - 0.03250109f, - 0.058700256f, - 0.046834726f, - -0.035081457f, - -0.0043140925f, - -0.09764087f, - -0.0034994273f, - -0.034056358f, - -0.019066337f, - -0.034376107f, - 0.012964423f, - 0.029291175f, - -0.012090671f, - 0.021585712f, - 0.028859599f, - -0.04391145f, - -0.071166754f, - -0.031040335f, - 0.02808108f, - -0.05621317f, - 0.06543945f, - 0.10094665f, - 0.041057374f, - -0.03222324f, - -0.063366964f, - 0.064944476f, - 0.023641933f, - 0.06806713f, - 0.06806097f, - -0.08220105f, - 0.04148528f, - -0.09254079f, - 0.044620737f, - 0.05526614f, - -0.03849534f, - -0.04722273f, - 0.0670776f, - -0.024274077f, - -0.016903497f, - 0.07584147f, - 0.04760533f, - -0.038843267f, - -0.028365409f, - 0.08022705f, - -0.039916333f, - 0.049067073f, - -0.030701574f, - -0.057169467f, - 0.043025102f, - 0.07109674f, - -0.047296863f, - -0.047463104f, - 0.040868305f, - -0.04409507f, - -0.034977127f, - -0.057109762f, - -0.08616165f, - -0.03486079f, - -0.046201482f, - 0.025963873f, - 0.023392359f, - 0.09594902f, - -0.007847159f, - -0.021231368f, - 0.009007263f, - 0.0032713825f, - -0.06876065f, - 0.03169641f, - -7.2582875E-4f, - -0.07049708f, - 0.03900843f, - -0.0075472407f, - 0.05184822f, - 0.06452079f, - -0.09832754f, - -0.012775799f, - -0.03925948f, - -0.029761659f, - 0.0065437574f, - 0.0815465f, - 0.0411695f, - -0.0702844f, - -0.009533786f, - 0.07024532f, - 0.0098710675f, - 0.09915362f, - 0.0415453f, - 0.050641853f, - 0.047463298f, - -0.058609713f, - -0.029499197f, - -0.05100956f, - -0.03441709f, - -0.06348122f, - 0.014784361f, - 0.056317374f, - -0.10280704f, - -0.04008354f, - -0.018926824f, - 0.08832836f, - 0.124804f, - -0.047645308f, - -0.07122146f, - -9.886527E-4f, - 0.03850324f, - 0.048501793f, - 0.07072816f, - 0.06566776f, - -0.013678872f, - 0.010010848f, - 0.06483413f, - -0.030036367f, - -0.029748922f, - -0.007482364f, - -0.05180385f, - 0.03698522f, - -0.045453787f, - 0.056604166f, - 0.029394176f, - 0.028589265f, - -0.012185886f, - -0.06919616f, - 0.0711641f, - -0.034055933f, - -0.053101335f, - 0.062319f, - 0.021600349f, - -0.038718067f, - 0.060814686f, - 0.05087301f, - -0.020297311f, - 0.016493896f, - 0.032162152f, - 0.046740912f, - 0.05461355f, - -0.07024665f, - 0.025609337f, - -0.02504801f, - 0.06765588f, - -0.032994855f, - -0.037897404f, - -0.045783922f, - -0.05689299f, - -0.040437017f, - -0.07904339f, - -0.031415287f, - -0.029216278f, - 0.017395392f, - 0.03449264f, - -0.025653394f, - -0.06283088f, - 0.049027324f, - 0.016229525f, - -0.00985347f, - -0.053974394f, - -0.030257035f, - 0.04325515f, - -0.012293731f, - -0.002446129f, - -0.05567076f, - 0.06374684f, - -0.03153897f, - -0.04475149f, - 0.018582936f, - 0.025716115f, - -0.061778374f, - 0.04196277f, - -0.04134671f, - -0.07396272f, - 0.05846184f, - 0.006558759f, - -0.09745666f, - 0.07587805f, - 0.0137483915f, - -0.100933895f, - 0.032008193f, - 0.04293283f, - 0.017870268f, - 0.032806385f, - -0.0635923f, - -0.019672254f, - 0.022225974f, - 0.04304554f, - -0.06043949f, - -0.0285274f, - 0.050868835f, - 0.057003833f, - 0.05740866f, - 0.020068677f, - -0.034312245f, - -0.021671802f, - 0.014769731f, - -0.07328285f, - -0.009586734f, - 0.036420938f, - -0.022188472f, - -0.008200541f, - -0.010765854f, - -0.06949713f, - -0.07555878f, - 0.045306854f, - -0.05424466f, - -0.03647476f, - 0.06266633f, - 0.08346125f, - 0.060288202f, - 0.0548457f }; - KnnVectorQueryBuilder knnQuery = new KnnVectorQueryBuilder("dense_field.inference.chunks.embeddings", vector, 10, 10, null); - NestedQueryBuilder nestedQueryBuilder = new NestedQueryBuilder("dense_field.inference.chunks", knnQuery, ScoreMode.Max); - var shardRequest = createShardSearchRequest(nestedQueryBuilder); - var sourceToParse = new SourceToParse( - "0", - Streams.readFully(SemanticTextHighlighterTests.class.getResourceAsStream("moby-dick.json")), - XContentType.JSON - ); - assertHighlightOneDoc(shardRequest, sourceToParse, "dense_field", new String[0]); - } } diff --git a/x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/mappings.json b/x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/mappings.json new file mode 100644 index 0000000000000..ce93875567cbe --- /dev/null +++ b/x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/mappings.json @@ -0,0 +1,30 @@ +{ + "_doc": { + "properties": { + "field": { + "type": "text", + "copy_to": [ + "sparse_field", + "dense_field" + ] + }, + "sparse_field": { + "type": "semantic_text", + "inference_id": ".elser-2-elasticsearch", + "model_settings": { + "task_type": "sparse_embedding" + } + }, + "dense_field": { + "type": "semantic_text", + "inference_id": ".multilingual-e5-small-elasticsearch", + "model_settings": { + "task_type": "text_embedding", + "dimensions": 384, + "similarity": "cosine", + "element_type": "float" + } + } + } + } +} \ No newline at end of file diff --git a/x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/queries.json b/x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/queries.json new file mode 100644 index 0000000000000..3c1987ab3021c --- /dev/null +++ b/x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/queries.json @@ -0,0 +1,388 @@ +{ + "dense_vector_1": [ + 0.09475211, + 0.044564713, + -0.04378501, + -0.07908551, + 0.04332011, + -0.03891992, + -0.0062305215, + 0.024245035, + -0.008976331, + 0.032832284, + 0.052760173, + 0.008123907, + 0.09049037, + -0.01637332, + -0.054353267, + 0.00771307, + 0.08545496, + -0.079716265, + -0.045666866, + -0.04369993, + 0.009189822, + -0.013782891, + -0.07701858, + 0.037278354, + 0.049807206, + 0.078036495, + -0.059533164, + 0.051413406, + 0.040234447, + -0.038139492, + -0.085189626, + -0.045546446, + 0.0544375, + -0.05604156, + 0.057408098, + 0.041913517, + -0.037348013, + -0.025998272, + 0.08486864, + -0.046678443, + 0.0041820924, + 0.007514462, + 0.06424746, + 0.044233218, + 0.103267275, + 0.014130771, + -0.049954403, + 0.04226959, + -0.08346965, + -0.01639249, + -0.060537644, + 0.04546336, + 0.012866155, + 0.05375096, + 0.036775924, + -0.0762226, + -0.037304543, + -0.05692274, + -0.055807598, + 0.0040082196, + 0.059259634, + 0.012022011, + -8.0863154E-4, + 0.0070405705, + 0.050255686, + 0.06810016, + 0.017190414, + 0.051975194, + -0.051436286, + 0.023408439, + -0.029802637, + 0.034137156, + -0.004660689, + -0.0442122, + 0.019065322, + 0.030806554, + 0.0064652697, + -0.066789865, + 0.057111286, + 0.009412479, + -0.041444767, + -0.06807582, + -0.085881524, + 0.04901128, + -0.047871742, + 0.06328623, + 0.040418074, + -0.081432894, + 0.058384005, + 0.006206527, + 0.045801315, + 0.037274595, + -0.054337103, + -0.06755516, + -0.07396888, + -0.043732334, + -0.052053086, + 0.03210978, + 0.048101492, + -0.083828256, + 0.05205026, + -0.048474856, + 0.029116616, + -0.10924888, + 0.003796487, + 0.030567763, + 0.026949523, + -0.052353345, + 0.043198872, + -0.09456988, + -0.05711594, + -2.2292069E-4, + 0.032972734, + 0.054394923, + -0.0767535, + -0.02710579, + -0.032135617, + -0.01732382, + 0.059442326, + -0.07686165, + 0.07104082, + -0.03090021, + -0.05450075, + -0.038997203, + -0.07045443, + 0.00483161, + 0.010933604, + 0.020874644, + 0.037941266, + 0.019729063, + 0.06178368, + 0.013503478, + -0.008584046, + 0.045592044, + 0.05528768, + 0.11568184, + 0.0041300594, + 0.015404516, + -3.8067883E-4, + -0.06365399, + -0.07826643, + 0.061575573, + -0.060548335, + 0.05706082, + 0.042301804, + 0.052173313, + 0.07193179, + -0.03839231, + 0.0734415, + -0.045380164, + 0.02832276, + 0.003745178, + 0.058844633, + 0.04307504, + 0.037800383, + -0.031050054, + -0.06856359, + -0.059114788, + -0.02148857, + 0.07854358, + -0.03253363, + -0.04566468, + -0.019933948, + -0.057993464, + -0.08677458, + -0.06626883, + 0.031657256, + 0.101128764, + -0.08050056, + -0.050226066, + -0.014335166, + 0.050344367, + -0.06851419, + 0.008698909, + -0.011893435, + 0.07741272, + -0.059579294, + 0.03250109, + 0.058700256, + 0.046834726, + -0.035081457, + -0.0043140925, + -0.09764087, + -0.0034994273, + -0.034056358, + -0.019066337, + -0.034376107, + 0.012964423, + 0.029291175, + -0.012090671, + 0.021585712, + 0.028859599, + -0.04391145, + -0.071166754, + -0.031040335, + 0.02808108, + -0.05621317, + 0.06543945, + 0.10094665, + 0.041057374, + -0.03222324, + -0.063366964, + 0.064944476, + 0.023641933, + 0.06806713, + 0.06806097, + -0.08220105, + 0.04148528, + -0.09254079, + 0.044620737, + 0.05526614, + -0.03849534, + -0.04722273, + 0.0670776, + -0.024274077, + -0.016903497, + 0.07584147, + 0.04760533, + -0.038843267, + -0.028365409, + 0.08022705, + -0.039916333, + 0.049067073, + -0.030701574, + -0.057169467, + 0.043025102, + 0.07109674, + -0.047296863, + -0.047463104, + 0.040868305, + -0.04409507, + -0.034977127, + -0.057109762, + -0.08616165, + -0.03486079, + -0.046201482, + 0.025963873, + 0.023392359, + 0.09594902, + -0.007847159, + -0.021231368, + 0.009007263, + 0.0032713825, + -0.06876065, + 0.03169641, + -7.2582875E-4, + -0.07049708, + 0.03900843, + -0.0075472407, + 0.05184822, + 0.06452079, + -0.09832754, + -0.012775799, + -0.03925948, + -0.029761659, + 0.0065437574, + 0.0815465, + 0.0411695, + -0.0702844, + -0.009533786, + 0.07024532, + 0.0098710675, + 0.09915362, + 0.0415453, + 0.050641853, + 0.047463298, + -0.058609713, + -0.029499197, + -0.05100956, + -0.03441709, + -0.06348122, + 0.014784361, + 0.056317374, + -0.10280704, + -0.04008354, + -0.018926824, + 0.08832836, + 0.124804, + -0.047645308, + -0.07122146, + -9.886527E-4, + 0.03850324, + 0.048501793, + 0.07072816, + 0.06566776, + -0.013678872, + 0.010010848, + 0.06483413, + -0.030036367, + -0.029748922, + -0.007482364, + -0.05180385, + 0.03698522, + -0.045453787, + 0.056604166, + 0.029394176, + 0.028589265, + -0.012185886, + -0.06919616, + 0.0711641, + -0.034055933, + -0.053101335, + 0.062319, + 0.021600349, + -0.038718067, + 0.060814686, + 0.05087301, + -0.020297311, + 0.016493896, + 0.032162152, + 0.046740912, + 0.05461355, + -0.07024665, + 0.025609337, + -0.02504801, + 0.06765588, + -0.032994855, + -0.037897404, + -0.045783922, + -0.05689299, + -0.040437017, + -0.07904339, + -0.031415287, + -0.029216278, + 0.017395392, + 0.03449264, + -0.025653394, + -0.06283088, + 0.049027324, + 0.016229525, + -0.00985347, + -0.053974394, + -0.030257035, + 0.04325515, + -0.012293731, + -0.002446129, + -0.05567076, + 0.06374684, + -0.03153897, + -0.04475149, + 0.018582936, + 0.025716115, + -0.061778374, + 0.04196277, + -0.04134671, + -0.07396272, + 0.05846184, + 0.006558759, + -0.09745666, + 0.07587805, + 0.0137483915, + -0.100933895, + 0.032008193, + 0.04293283, + 0.017870268, + 0.032806385, + -0.0635923, + -0.019672254, + 0.022225974, + 0.04304554, + -0.06043949, + -0.0285274, + 0.050868835, + 0.057003833, + 0.05740866, + 0.020068677, + -0.034312245, + -0.021671802, + 0.014769731, + -0.07328285, + -0.009586734, + 0.036420938, + -0.022188472, + -0.008200541, + -0.010765854, + -0.06949713, + -0.07555878, + 0.045306854, + -0.05424466, + -0.03647476, + 0.06266633, + 0.08346125, + 0.060288202, + 0.0548457 + ] +} \ No newline at end of file diff --git a/x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/moby-dick.json b/x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/sample-doc.json similarity index 100% rename from x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/moby-dick.json rename to x-pack/plugin/inference/src/test/resources/org/elasticsearch/xpack/inference/highlight/sample-doc.json