Comments (3)
It's possible SearchKit doesn't generate and return the highlighted results the same way Algolia does for nested attributes. You would have to check with them in that instance.
from instantsearch.
Hi, you'll need to set the root level of your hierarchical attribute in attributesToHighlight
in order to retrieve highlights for sub levels, for example:
<InstantSearch>
<Configure attributesToHighlight={['metadata']} /> {/* This can also be done in the Dashboard */}
<Hits hitComponent={HitComponent} />
</InstantSearch>
// ...
function HitComponent({ hit }) {
return <div>
<Highlight attribute="metadata.publisher" hit={hit} />
</div>;
}
from instantsearch.
Thanks a lot for the hint, but I'm a bit confused, mainly because of not understanding the difference between using search_settings and the Configuration-Component and how their setting relate to each other.
While configuring SearchKit I'm providing the highlight_attributes, which looks as follows:
search_settings: {
search_attributes: ['metadata.publisher'],
result_attributes: ['metadata.publisher'],
highlight_attributes: ['metadata.publisher']
}
If I provide there only 'metadata' in 'highlight_attributes', the _highlightResult will be:
{
"metadata" : {
"matchLevel":"none",
"matchedWords":[],
"value":"[object Object]"
}
}
However, the Highlight-Component seems not to be able to deal with "[object Object]", so it remains empty not matter of adding Configuration or not.
Instead, when using your code, _highlightResult again looks like
{
"metadata.publisher" : {
"fullyHighlighted":false,
"matchLevel":"full",
"matchedWords" : ["Albert"],
"value":"<mark>Albert</mark> E"
}
}
but the Highlight-Component still receives no value.
from instantsearch.
Related Issues (20)
- deserializeQueryParameters - TypeError: Cannot read properties of undefined (reading 'split') HOT 4
- Samsung Note 20 Chrome has erratic behavior HOT 5
- Bug: Next 13 with App Router and Streaming Enabled causes issues with Browser Navigation & RefinementList Widget HOT 4
- <Configure /> types wrong or conflict with documentation HOT 8
- Autocomplete not creating correct urls in nextjs. HOT 1
- NextJS `router.query` is stale after hitting back button HOT 7
- Improve load-time performance of widgets HOT 3
- RouteState does not change on popstate
- Vue <AisInstantSearch /> fails to start with Vue 3 and @vue/compat
- combinedAnswers.attributesToDisplay?.filter is not a function HOT 4
- React native 0.73.2 ( expo 50 ), do not send any network requests HOT 3
- A plugin must either be a function or an object with an "install" function HOT 4
- `indexId` missing in `AutocompleteRenderState` type while being listed in the docs HOT 2
- Rollup build error after upgrade to 4.65.0 HOT 6
- `useHits()` loose its page state in nextjs app router
- Autocomplete : getWidgetRenderState giving me initial null result
- TypeError: Cannot read property 'state' of null HOT 11
- html template function returns "undefined" with empty string HOT 2
- Filter is not working via URL when its on same page: Next.js App Routing HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instantsearch.