...
// add transformItems so we can log for debugging
instantsearch.widgets.hits({
container: '#hits',
transformItems(items) {
console.log('Here are the results', items)
return items
},
...
2. Search 'half' in the playground
### Expected behavior
Searching 'half' in the vanillajs playground should give this as the first hit
Note the `_matchesPosition` field in the json below
<details>
<summary>Expected first result</summary>
```json
{
"name": [
{
"start": 0,
"length": 4
}
],
"description": "Return to the Black Mesa Research Facility as one of the military specialists assigned to eliminate Gordon Freeman. Experience an entirely new episode of single player action. Meet fierce alien opponents and experiment with new weaponry. Named Game of the Year by the Academy of Interactive Arts and Sciences.",
"id": "50",
"price": "4.99 $",
"image": "http://steam.meilisearch.dev/steam/apps/50/header.jpg?t=1447350813",
"releaseDate": "Nov 1 1999",
"recommendationCount": 2934,
"platforms": [
"MacOS",
"Linux",
"Windows"
],
"players": [
"Single player",
"Multiplayer"
],
"genres": [
"Action"
],
"misc": [],
"_highlightResult": {
"name": {
"value": "<mark>Half</mark>-Life: Opposing Force"
},
"description": {
"value": "Return to the Black Mesa Research Facility as one of the military specialists assigned to eliminate Gordon Freeman. Experience an entirely new episode of single player action. Meet fierce alien opponents and experiment with new weaponry. Named Game of the Year by the Academy of Interactive Arts and Sciences."
},
"id": {
"value": "50"
},
"price": {
"value": "4.99 $"
},
"image": {
"value": "http://steam.meilisearch.dev/steam/apps/50/header.jpg?t=1447350813"
},
"releaseDate": {
"value": "Nov 1 1999"
},
"recommendationCount": {
"value": "2934"
},
"platforms": [
{
"value": "MacOS"
},
{
"value": "Linux"
},
{
"value": "Windows"
}
],
"players": [
{
"value": "Single player"
},
{
"value": "Multiplayer"
}
],
"genres": [
{
"value": "Action"
}
],
"misc": []
},
"_snippetResult": {
"name": {
"value": "<mark>Half</mark>-Life: Opposing Force"
},
"description": {
"value": "Return to the Black Mesa Research Facility as one of the military specialists assigned to eliminate Gordon Freeman. Experience an entirely new episode of single player action. Meet fierce alien opponents and experiment with new weaponry. Named Game of the Year by the Academy of Interactive Arts and Sciences."
},
"id": {
"value": "50"
},
"price": {
"value": "4.99 $"
},
"image": {
"value": "http://steam.meilisearch.dev/steam/apps/50/header.jpg?t=1447350813"
},
"releaseDate": {
"value": "Nov 1 1999"
},
"recommendationCount": {
"value": "2934"
},
"platforms": [
{
"value": "MacOS"
},
{
"value": "Linux"
},
{
"value": "Windows"
}
],
"players": [
{
"value": "Single player"
},
{
"value": "Multiplayer"
}
],
"genres": [
{
"value": "Action"
}
],
"misc": []
},
"_matchesPosition": {
"name": [
{
"start": 0,
"length": 4
}
]
},
"__position": 1
}
Current behavior
No _matchesPosition field in first result for 'half' query
Current first result
```json
{
"name": [
{
"start": 0,
"length": 4
}
],
"description": "Return to the Black Mesa Research Facility as one of the military specialists assigned to eliminate Gordon Freeman. Experience an entirely new episode of single player action. Meet fierce alien opponents and experiment with new weaponry. Named Game of the Year by the Academy of Interactive Arts and Sciences.",
"id": "50",
"price": "4.99 $",
"image": "http://steam.meilisearch.dev/steam/apps/50/header.jpg?t=1447350813",
"releaseDate": "Nov 1 1999",
"recommendationCount": 2934,
"platforms": [
"MacOS",
"Linux",
"Windows"
],
"players": [
"Single player",
"Multiplayer"
],
"genres": [
"Action"
],
"misc": [],
"_highlightResult": {
"name": {
"value": "Half-Life: Opposing Force"
},
"description": {
"value": "Return to the Black Mesa Research Facility as one of the military specialists assigned to eliminate Gordon Freeman. Experience an entirely new episode of single player action. Meet fierce alien opponents and experiment with new weaponry. Named Game of the Year by the Academy of Interactive Arts and Sciences."
},
"id": {
"value": "50"
},
"price": {
"value": "4.99 $"
},
"image": {
"value": "http://steam.meilisearch.dev/steam/apps/50/header.jpg?t=1447350813"
},
"releaseDate": {
"value": "Nov 1 1999"
},
"recommendationCount": {
"value": "2934"
},
"platforms": [
{
"value": "MacOS"
},
{
"value": "Linux"
},
{
"value": "Windows"
}
],
"players": [
{
"value": "Single player"
},
{
"value": "Multiplayer"
}
],
"genres": [
{
"value": "Action"
}
],
"misc": []
},
"_snippetResult": {
"name": {
"value": "Half-Life: Opposing Force"
},
"description": {
"value": "Return to the Black Mesa Research Facility as one of the military specialists assigned to eliminate Gordon Freeman. Experience an entirely new episode of single player action. Meet fierce alien opponents and experiment with new weaponry. Named Game of the Year by the Academy of Interactive Arts and Sciences."
},
"id": {
"value": "50"
},
"price": {
"value": "4.99 $"
},
"image": {
"value": "http://steam.meilisearch.dev/steam/apps/50/header.jpg?t=1447350813"
},
"releaseDate": {
"value": "Nov 1 1999"
},
"recommendationCount": {
"value": "2934"
},
"platforms": [
{
"value": "MacOS"
},
{
"value": "Linux"
},
{
"value": "Windows"
}
],
"players": [
{
"value": "Single player"
},
{
"value": "Multiplayer"
}
],
"genres": [
{
"value": "Action"
}
],
"misc": []
},
"__position": 1
}
```
Description
When using showMatchesPosition=true, the
_matchesPosition
field does not appear in the instantsearch hits.I believe I narrowed this down and is due to the _matchesPosition not being assigned to the adapted hit here.
Reproducing
showMatchesPosition
:... // add transformItems so we can log for debugging instantsearch.widgets.hits({ container: '#hits', transformItems(items) { console.log('Here are the results', items) return items }, ...
Current behavior
No
_matchesPosition
field in first result for 'half' queryCurrent first result
```json { "name": [ { "start": 0, "length": 4 } ], "description": "Return to the Black Mesa Research Facility as one of the military specialists assigned to eliminate Gordon Freeman. Experience an entirely new episode of single player action. Meet fierce alien opponents and experiment with new weaponry. Named Game of the Year by the Academy of Interactive Arts and Sciences.", "id": "50", "price": "4.99 $", "image": "http://steam.meilisearch.dev/steam/apps/50/header.jpg?t=1447350813", "releaseDate": "Nov 1 1999", "recommendationCount": 2934, "platforms": [ "MacOS", "Linux", "Windows" ], "players": [ "Single player", "Multiplayer" ], "genres": [ "Action" ], "misc": [], "_highlightResult": { "name": { "value": "Half-Life: Opposing Force" }, "description": { "value": "Return to the Black Mesa Research Facility as one of the military specialists assigned to eliminate Gordon Freeman. Experience an entirely new episode of single player action. Meet fierce alien opponents and experiment with new weaponry. Named Game of the Year by the Academy of Interactive Arts and Sciences." }, "id": { "value": "50" }, "price": { "value": "4.99 $" }, "image": { "value": "http://steam.meilisearch.dev/steam/apps/50/header.jpg?t=1447350813" }, "releaseDate": { "value": "Nov 1 1999" }, "recommendationCount": { "value": "2934" }, "platforms": [ { "value": "MacOS" }, { "value": "Linux" }, { "value": "Windows" } ], "players": [ { "value": "Single player" }, { "value": "Multiplayer" } ], "genres": [ { "value": "Action" } ], "misc": [] }, "_snippetResult": { "name": { "value": "Half-Life: Opposing Force" }, "description": { "value": "Return to the Black Mesa Research Facility as one of the military specialists assigned to eliminate Gordon Freeman. Experience an entirely new episode of single player action. Meet fierce alien opponents and experiment with new weaponry. Named Game of the Year by the Academy of Interactive Arts and Sciences." }, "id": { "value": "50" }, "price": { "value": "4.99 $" }, "image": { "value": "http://steam.meilisearch.dev/steam/apps/50/header.jpg?t=1447350813" }, "releaseDate": { "value": "Nov 1 1999" }, "recommendationCount": { "value": "2934" }, "platforms": [ { "value": "MacOS" }, { "value": "Linux" }, { "value": "Windows" } ], "players": [ { "value": "Single player" }, { "value": "Multiplayer" } ], "genres": [ { "value": "Action" } ], "misc": [] }, "__position": 1 } ```Environment: