Comments (6)
Hiya could you share the configuration aswell? Maybe there’s a bug here with object fields
from searchkit.
I'm afraid it's too simple to contain any bugs, but let's have a look:
const sk = new Searchkit({
connection: {
host: "http://localhost:9200",
},
search_settings: {
search_attributes: ['metadata.titles.value', 'metadata.publisher'],
result_attributes: ['metadata.titles.value', 'metadata.publisher'],
highlight_attributes: ['metadata.publisher']
}
})
Maybe for completeness, the rest of the code:
const searchClient = Client(sk);
function HitComponent({ hit }) {
return <div>
<Highlight attribute="metadata.publisher" hit={hit} />
</div>;
}
function App() {
return (
<InstantSearch indexName="test_index" searchClient={searchClient}>
<Configure attributesToHighlight={['metadata']} /> {/* This can also be done in the Dashboard */}
<SearchBox />
<Hits hitComponent={HitComponent}/>
</InstantSearch>
);
}
Adding the Configure-Component was a hint I received from the Algolia guys, but it had no effect.
from searchkit.
could you try this with another field thats not using object field? IE, make 'metadata.publisher
just publisher
and try? When I have some time, will create a test case for this if it works to figure out the object issue.
from searchkit.
I've already checked this yesterday and I just realized that I did not submit my comment. -.-
As expected, with a simple key it is working as intended as the response is similar to my 'hack' where I modified the result via
hit._highlightResult['test'] = hit._highlightResult['metadata.publisher'];
from searchkit.
sounds like a bug within Searchkit for highlighting on object fields. This is the code for highlighting and tests. Likely will take me next weekend to look into this but very happy for a PR to resolve the issue if you can.
Joe
from searchkit.
found the issue that instantsearch requires object fields to be represented in a object hierarchy, not currently as a 1 depth dot notation keys. Fixed this by transforming ES dot notation keys into an object hierarchy.
Got a PR fixing this and should work. Let me know if you have issues.
from searchkit.
Related Issues (20)
- Accessibility features for SearchKit components Inquiry HOT 2
- Access `fields` from the query results
- Add runtime_mappings to the top level of request_body HOT 1
- Can't use sorting HOT 3
- Can you support vue2 version 2.* ? HOT 1
- "Does Searchkit for Vue 2 support or have an implementation of 'searchOnLoad' for creating a manager?" HOT 1
- Not able to implement latest version (4.0.0) of searhkit, earlier had serchkit-carnary version HOT 4
- Is there any GraphQL support? HOT 4
- Cannot connect to SearchKit with ESv8 Security Cert HOT 1
- react-Instantsearch 7.3 issues HOT 1
- Unable to access event listeners for DateRangeFacet in v3 HOT 1
- How to distinct your index ? HOT 2
- Ranking attributes HOT 1
- Algolia v7 API and date filter not working HOT 1
- wrapping SearchKitClient requests with a react component
- Elasticsearch Cloud | Index not getting set correctly HOT 1
- Error: Error transforming Elasticsearch response for index HOT 1
- Change Query / Adjust Query Relevance easily
- Wrong content type: "application/json" HOT 2
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 searchkit.