question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v0.7.0 - v0.7.11: can not determine when the exporting process has been completed

See original GitHub issue

The new export((key, data) => ()) API that uses callbacks makes it impossible to know when the export-ing process is complete.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
joebochillcommented, Jun 30, 2021

I’m having the exact same issue as @browniefed with export/import. There’s always zero results on the index doing the importing. I’m sure I’m doing something wrong, but I’m not sure what.

3reactions
browniefedcommented, Jun 26, 2021

On a similar topic of import/export, I’ve got no idea why this would/wouldn’t work. It states that import is async but I cannot tell whether that is true or not as it just returns undefined rather than a Promise or a callback, or something.

Just in general I cannot seem to get import/export working with a filesystem or just in memory at all.

Basically my goal is to write write key as a filename and write the data, then at a future point import the index and do a search. That just doesn’t seem to work.

const { Index } = require("flexsearch");

const index = new Index();
const index2 = new Index();

// Loop and index bunch-o-content
index.add(item.title, content);


const result = index.search("textinput");

index.export((key, data) => {
// Just testing if we can recreate a search
  index2.import(key, data);
// Saving for future
  fs.writeFile(`./index/${key}`, data);
});

setTimeout(() => {
  const res = index2.search("textinput");
  console.log(result);
  console.log(res);
}, 1000);

// Index initial result // Index 2 no results even after import

[
// Returns results from initial Index
]
// res has no results even though we imported and did the same search.
[]

Using: “flexsearch”: “^0.7.11”,

Read more comments on GitHub >

github_iconTop Results From Across the Web

The td-agent Change Log - Product Documentation
This article describes the differences between td-agent2 and td-agent3. td-agent2 is for existing td-agent2 and fluentd v0.12 users. If you have ...
Read more >
Getting Started — Nerves v1.6.0 - HexDocs
Built from a firmware bundle and contains the partition table, partitions, bootloader, etc. Creating a new Nerves app. Before you start using Nerves,...
Read more >
Update v0.13.3 | Elastic Security Solution [7.17] | Elastic
A machine learning job detected AWS command activity that, while not inherently suspicious or abnormal, is sourcing from a geolocation (city) that is...
Read more >
Revision history - refs/heads/v0.8.27-release - snapshot ...
Fixes #5927 This is a backport of dfb0461 (see #5930) to the v0.8 branch. ... The test has been dropped as it's not...
Read more >
Node.js v19.3.0 Documentation
Added in: v0.6.12. Every .html document has a corresponding .json document. This is for IDEs and other utilities that consume the documentation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found