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.

Package assumes autopublish: Did not receive an index or an array of indexes (using subscribe/publish)

See original GitHub issue
let Players = new Meteor.Collection('players'),
  PlayersIndex = new EasySearch.Index({
    collection: Players,
    fields: ['name'],
    engine: new EasySearch.MongoDB()
  });

Template.searchBox.helpers({
  playersIndex: () => PlayersIndex
});

Where exactly is this supposed to go? The let syntax is read as invalid by the linter in Meteor. This indicates to me it needs to go into a helper, but this doesn’t make sense due to the fact that you’re creating a new collection.

The previous syntax to create an index appeared like this:

Trackers.initEasySearch(
  [
    'stuff'
  ], {
  'limit': 5,
  'use': 'mongo-db'
});

…which appears to still work.

I’ve checked your documentation on the site, but this is completely inconsistent across the site.

Maybe this should be titled “fix your documentation”.

I can’t seem to get even a basic search working with version 2.0.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jpbourgeoncommented, Oct 25, 2015

This might help.

The getComponentDict method is not available before the template has been rendered. You cannot access it from the helpers otherwise it will return undefined. However it is available inside onRendered and events methods.

Here is how I access the count in my helpers, through a Session variable :

Template.collectivities.onRendered(function() {
  Tracker.autorun(function() {
    var dict = index.getComponentDict();
    Session.set('count', dict.get('count'));
  });
});

Template.collectivities.helpers({
  count: function() {
    return Session.get('count');
  }
});
1reaction
matteodemcommented, Oct 25, 2015
  1. According to the UPGRADE-2.0.md the package code now uses ES2015, which means that all the examples also use ES2015 code. If let is invalid, then you’re missing the ecmascript package.
  2. Might be an issue that has to do with not having ES2015 available in your project.

Which version of meteor are you using?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Publishing an empty array does not publish the array with ...
The global array will be shown as defined with 50 indexes, but published empty. This shows in the workflow report: U00020237 The object...
Read more >
Indexed Database API 3.0 - W3C
This index is used to look up books by title, and will prevent adding books with non-unique titles. Book records also have an...
Read more >
Indexing vectors and arrays in Python
Indexing is the way to do these things. A key point to remember is that in python array/vector indices start at 0. Unlike...
Read more >
Publish messages to topics | Cloud Pub/Sub - Google Cloud
Pub/Sub offers at-least-once message delivery and best-effort ordering to existing subscribers. The general flow for a publisher application is: Create a ...
Read more >
python - Numpy: For every element in one array, find the index ...
I want to suggest one-line solution: indices = np.where(np.in1d(x, y))[0]. The result is an array with indices for x array which corresponds ...
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