-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add alias for fields in strapi. #55
Comments
Hey @MSid01, Thanks for your feature request, I think this could be a good addition. If you want, feel free to submit an PR for this, if you need any help on setting up the workflow let me know. 👍🏼 |
Can be something like: module.exports = ({ env }) => ({
search: {
enabled: env.bool('SEARCH_PLUGIN', false),
config: {
// ...
contentTypes: [
{
name: 'api::episode.episode',
index: 'episode',
fields: [
'id',
'title',
'subtitle',
// computed field
{
field: '_geoloc',
resolve: (entity) => ({
lat: entity.jsonField.lat,
lon: entity.jsonField.lon,
}),
},
// async computed field
{
field: '_external',
resolve: async (entity) => {
// index external data
const data = await something(entity);
return data
},
},
],
},
],
},
},
}); |
@stafyniaksacha, that is a sweet config example, I really like to add computed fields and/or some sort of lifecyles. 🙏🏼 |
I want to use geosearch widget from algolia and it requires _geoloc object in the hits or record in the index. The problem is strapi does not allow to use "_geoloc" as its field name( it violates regex pattern).
The text was updated successfully, but these errors were encountered: