travis-r6s / gridsome-plugin-flexsearch

Add lightning fast search to Gridsome with FlexSearch
24 stars 7 forks source link

Tags object #51

Closed ramsesgarate closed 3 years ago

ramsesgarate commented 4 years ago

Currently this is my plugin configuration:

{
      use: 'gridsome-plugin-flexsearch',
      options: {
        flexsearch: {
          cache: true,
          profile: 'match'
        },
        collections: [{
          typeName: 'Post',
          indexName: 'Post',
          fields: ['title', 'description', 'tags', 'date']
        }],
        searchFields: ['title', 'tags'],
      }
    }

Is there any way that the tag output would look like this?

[
  {
    "id":"markdown",
    "title":"markdown",
    "path":"/tag/markdown/"
  },
  {
    "id":"test-files",
    "title":"test-files",
    "path":"/tag/test-files/"
  }
]

Currently returns an array with only the title

[
  "markdown",
  "test-files"
]

I was trying to use a query like I suggested on the plugin page, but I think I didn't configure it well, because it doesn't generate any results for me, so I decided to continue with the normal configuration.

travis-r6s commented 4 years ago

@ramsesgarate Thanks for reporting this. I hadn't tested it with the source filesystem -> refs config, it seems that it creates that relation after this plugin fetches the nodes. I'll try and take a look at this.

travis-r6s commented 3 years ago

@ramsesgarate I have made some updates to this plugin on the graphql branch - if you get the time, could you check to see if it fixes this issue for you?