typesense / firestore-typesense-search

Firebase Extension to automatically push Firestore documents to Typesense for full-text search with typo tolerance, faceting, and more
https://extensions.dev/extensions/typesense/firestore-typesense-search
Apache License 2.0
150 stars 27 forks source link

Strings for Hits and Fields #41

Closed RyPoints closed 1 year ago

RyPoints commented 1 year ago

I created a Typesense Cloud instance and installed this extension. I see [Object] and [Array] for a bunch of the fields that are text in the Typesense documentation. Is there a way to get the string fields back via configuration?

[
  {
    created_at: 1673020497,
    default_sorting_field: '',
    fields: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
    name: 'companies',
    num_documents: 4,
    symbols_to_index: [],
    token_separators: []
  }
]
{
  facet_counts: [],
  found: 1,
  hits: [
    {
      document: [Object],
      highlights: [Array],
      text_match: 72341265420713980
    }
  ],
  out_of: 4,
  page: 1,
  request_params: { collection_name: 'companies', per_page: 10, q: 'stackoverflow' },
  search_cutoff: false,
  search_time_ms: 0
}
jasonbosco commented 1 year ago

If you console.log the output, that method prints out large objects and arrays in a truncated format, but the data is still there.

Here's how to log the full object: https://stackoverflow.com/questions/10729276/how-can-i-get-the-full-object-in-node-jss-console-log-rather-than-object

RyPoints commented 1 year ago

Thanks. Per your link I just added JSON.stringify(searchResults, null, 4); to what I was logging and see the data.