Closed sGerli closed 2 years ago
same here
hope it gets fixed
I just created a pull request to fix the issue: https://github.com/dimitrov-adrian/directus-extension-searchsync/pull/18
Hello, could you post a working example of this behaviour please? I can't seem to make it work on a many to many relationship.
My schema looks like this and I want to include collection.categories.category.title
to the search index.
collection {
date_created
title
categories {
category {
title
description
}
}
}
Thanks a lot!
I also need an example for this. @narduin @dimitrov-adrian @sGerli Thx a lot :-D
Hi @TorbenHammes, I was able to make something kinda work with the following conf. I had to switch from a .json
to a .js
conf file.
// .searchsyncrc.js
const config = {
server: {...},
collections: {
missions: {
collectionField: "_collection",
filter: {
status: "published",
},
fields: ["title", "slug", "content", "categories.category.title"],
transform: (item, { flattenObject, striptags }) => {
return {
...flattenObject(item),
content: striptags(item.content),
category: item.categories[0].category.title,
};
},
},
},
};
// Use as object.
module.exports = config;
This conf indexes correctly title
, slug
, content
and category
but it also creates an empty categories.0.category.title
.
I guess I'm doing something wrong but I don't know what :)
@narduin
const config = {
server: {
...
},
collections: {
collection: {
filter: {
...
},
fields: [
"categories.category.title"
],
},
},
};
module.exports = config;
Thank you ππΌππΌππΌ
Hi, I have a similar problem with a meilisearch and no related date is written in the index, e.g. 'category.title'. Fixes the #18 only easticsearch?
Thanks for any help.
Tested using Directus 9.21 and Meilisearch 0.30
When trying to index a collection with a relationship field like
thumbnail.filename_disk
it doesn't index that field.I've only seen the id working, if you add
thumbnail
as the field it will index just the id. But sometimes you need other data, like in the case of the author of a post you might want to index the name, butauthor.name
won't work.Tested using Directus v9.10.0