travis-r6s / gridsome-plugin-flexsearch

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

Field date #50

Closed ramsesgarate closed 4 years ago

ramsesgarate commented 4 years ago

Hello, I have problems with the date fields, it comes empty, any idea what it could be? I have no problem with any other, just this one.

This is my configuration:

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

This is the result of a search

[
   {
      "id":"7d602614-d177-428f-8096-ea1cd1bdd008",
      "index":"Post",
      "path":"/blog/hello-gridsome/",
      "node":{
         "title":"Hola Gridsome 🎉",
         "description":"A new static site generator baby is born. It's highly inspired by Gatsby.js (React based) but built on top of Vue.js. We have been working on it for a year and will have a beta ready soon. You can expect this baby to grow up fast!",
         "date":{

         }
      },
      "tags":"[\"markdown\",\"releases\"]",
      "title":"Hola Gridsome 🎉"
   },
   {
      "id":"b9ad516f-762f-4648-8f05-ccd7485fc42e",
      "index":"Post",
      "path":"/blog/test-publication/",
      "node":{
         "title":"Prueba de publicación",
         "description":"Markdown is intended to be as easy-to-read and easy-to-write as is feasible. Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it's been marked up with tags or formatting instructions.",
         "date":{

         }
      },
      "tags":"[\"markdown\",\"test-files\"]",
      "title":"Prueba de publicación"
   }
]
travis-r6s commented 4 years ago

@ramsesgarate Also missed this - the date is returned as a timestamp, so I just need to update the plugin to make sure it is stored as a string.

travis-r6s commented 4 years ago

Just fixed this - will release an update soon.