Code Monkey home page Code Monkey logo

meteor-easy-search's Introduction

Easy Search Build Status Get help on Codementor

Easy Search is a simple and flexible solution for adding search functionality to your Meteor App. Use the Blaze Components + Javascript API to get started.

import { Index, MinimongoEngine } from 'meteor/easy:search'

// On Client and Server
const Players = new Mongo.Collection('players')
const PlayersIndex = new Index({
  collection: Players,
  fields: ['name'],
  engine: new MinimongoEngine(),
})
// On Client
Template.searchBox.helpers({
  playersIndex: () => PlayersIndex,
});
<template name="searchBox">
    {{> EasySearch.Input index=playersIndex }}

    <ul>
        {{#EasySearch.Each index=playersIndex }}
            <li>Name of the player: {{name}}</li>
        {{/EasySearch.Each}}
    </ul>
</template>

Check out the searchable leaderboard example or have a look at the current documentation (v1 docs) for more information.

How to install

cd /path/to/project
meteor add easy:search

meteor-easy-search's People

Contributors

bompi88 avatar dburles avatar erasaur avatar ilshidur avatar laosb avatar matteodem avatar mitar avatar moonrockfamily avatar rjsmith avatar roelvan avatar techplexengineer avatar timbrandin avatar timothyarmes avatar tpxp avatar volodymyr-k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteor-easy-search's Issues

Nested fields

It seems like it's not possible to use nested fields (e.g. profile.name) when creating an index with EasySearch.createSearchIndex(). Can anybody confirm this?

fuzzy search

hello,

I was wondering if the default, reactive option can do fuzzy searches as well? I'm sorry but I couldn't find it in the documentation.

Thanks

Send only certain fields to client

This is a great package and it works perfectly using the blaze components.

I want to make a performance improvement though by publishing only certain fields of the search results to the client. My documents are rather large and I don't want to send all of it to the client, just certain fields similar to the "fields"-parameter in Meteor.publish. Is that possible somehow?

Thank you,

Tony

P.S.: Is it possible to only execute the search when enter is hit and not every time the user types a new character?

Deployment Issues

I'm using mup for deploy to my DO

I first ssh into my server and installed elastic search and started elastic search with default config(port 9200)

/etc/init.d/elasticsearch start

and the service is started and then when I try to deploy to server using mup

It throws error and showing the following errors in logs

mup logs -n 400

logs

Elasticsearch WARNING: 2014-10-06T11:54:33Z
  No living connections

Had error adding a document!
{ [Error: No Living connections] message: 'No Living connections' }
Elasticsearch WARNING: 2014-10-06T11:54:33Z
  Unable to revive connection: http://localhost:9200/

Is this the way to use the elasticsearch on servers or Is there any other way?

Search is empty callback/template

I am using the search as a filter and I would like to show all results initially, a relatively small list. Then as the user types only show relevant results. Finally if the user clears the search show the full list again.

I would love something like:

{{#ifEsSearchIsEmpty}}
  show full list
{{/ifEsSearchIsEmpty}}

MongoDB search return related documents as well?

I've got two collections. TV Shows and Episodes.

When users search for TV Shows, the search works perfectly fine. However, I also want to show a few latest episodes of the specific tv show in the search result. I'm just wondering if there is something like the publish function that meteor provides that is exposed with EasySearch so we can also attach related documents when returning the search results.

Example of esAutosuggest renderSuggestion option?

I am trying the following:

{{> esAutosuggest index="items" id="autosuggest" renderSuggestion="itemResult"}}

Elsewhere I define the template itemResult:

<template name="itemResult">
    <li>{{name}} {{summary}}</li>
</template>

However, I get an error on this line of Blaze, and the value of template is the string "itemResult" rather than a Blaze template:

    if (! Blaze.isTemplate(template))
      throw new Error("Expected template or null, found: " + template);

Many thanks for your help!

Error on collection

Exception from Deps recompute function: TypeError: Cannot read property 'collection' of undefined

Might also be relevant that I am using Collection2 with AutoForm.

Multiple index support for conditional components {{#ifEs...}}

Should be possible to use ifEsIsSearching and ifEsHasNoResults with multiple indexes. With the esInput template we can specify index=indexes, where indexes is an array of index names, so it seems logical that we could use index=indexes on both of the if helpers above. This would work around some ugly else-if block structuring when searching across multiple indexes in parallel.

Perhaps the user could specify whether the tests are against the conjunction or disjunction of the specified indexes, and default to conjunction?

limit

Limit no longer limits the search to 10 when using something like this

Collection.initEasySearch(['...', '...'], { 'defaultLimit': 10} or
Collection.initEasySearch(['...', '...'], { 'limit': 10}

Both result in 50 results. Has something been changed? I looked in the documentation but I couldn't find an api change.

Thanks

Support for local collections (client only)

I would like to do the following:

#client only
@example = new Meteor.Collection null
example.createSearchIndex ['someField']

Currently I get this in my chrome console:

Exception in delivering result of invoking 'easySearch': Error
    at http://localhost:3000/packages/matteodem:easy-search.js?6b83b1a66ac69185c0b097d0c9dcbb80bfb04a2f:469:23
    at null._callback (http://localhost:3000/packages/meteor.js?47d1d2b71177463dc159606cf930e44b9e3337f6:831:22)
    at _.extend._maybeInvokeCallback (http://localhost:3000/packages/livedata.js?32d6f3870045baedecfa7c0d90861ead2810da37:3802:12)
    at _.extend.receiveResult (http://localhost:3000/packages/livedata.js?32d6f3870045baedecfa7c0d90861ead2810da37:3822:10)
    at _.extend._livedata_result (http://localhost:3000/packages/livedata.js?32d6f3870045baedecfa7c0d90861ead2810da37:4831:9)
    at onMessage (http://localhost:3000/packages/livedata.js?32d6f3870045baedecfa7c0d90861ead2810da37:3667:12)
    at http://localhost:3000/packages/livedata.js?32d6f3870045baedecfa7c0d90861ead2810da37:2710:11
    at Array.forEach (native)
    at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:156:11)
    at self.socket.onmessage (http://localhost:3000/packages/livedata.js?32d6f3870045baedecfa7c0d90861ead2810da37:2709:11) debug.js:41

I converted this to a server + client full collection and it worked fine.

Simple Regexes

Does this package just use simple regex matching to do the search or does it take advantage of any plugins like (elasticsearch) ?

How to install

How do I install this? and can it work even with just the meteor mongodb, no elastisearch?

FilterBy on search

@matteodem still loving this package. I am now using this in another app and I need a filter by, ideally on the server for security reasons. I have something close to the following:

//Groups 
{
  users: [userIds]
}
//Items
{
 name: 'name'
 group: groupId
}

Assuming there is not an existing/better way to do this. I would like to do:

EasySearch.createSearchIndex('items', {
  'collection'    : Items,
  'field'         : ['name']
 //filter by magic here? That limits by groups the user has access to
  }
});
//OR (likely easier)
EasySearch.search('items', 'someName', filterBy: 'groupId', function (err, data) {
});
//with some kind of server-side security check

Connection Error

Hey, when I do a clean install of meteor-easy-search, I get a connection error.

Error: connect ECONNREFUSED
W20140328-20:32:36.321(-7)? (STDERR)     at errnoException (net.js:901:11)
W20140328-20:32:36.322(-7)? (STDERR)     at Object.afterConnect [as oncomplete] (net.js:892:19)

I also get this same error when running your leaderboard example. Any idea what's wrong?

Thanks in advance for your help!

Making an on server search

Hi,

i´m trying to achieve an on server pre selection of my search. If i´m right, at the moment the whole collection needs to be published to the client and easy search is displaying the searchresult subset. I just want to publish the search results subset to the client not the whole collection. Could you give me a hint to achieve that?

Thanks!!!!

Clear search results

I am not sure but is there an underlying function within the source code to explicitly reset the search input esInput and the search results. Users of my application have found the search results stale when they browse away from a route and I would like to reset it back or I should say run a clear, if that is possible ?

IndexMissingException[[videoSearch] missing]] error

I've created a search index in common code

Videos = new Mongo.Collection("myvideos");
EasySearch.createSearchIndex('videoSearch', {
  'collection'    : Videos,              // instanceof Meteor.Collection
  'field'         : ['title', 'tags'],    // can also be an array of fields
  'limit'         : 20,                   // default: 10
  'use'           :"elastic-search"
});

and in the client side template helper I'm calling this index by

EasySearch.search('videoSearch',"mkbhd", function (err, data) {
            console.log(err);
            console.log(data);
        });

I've started the elastic search service and in the server side(terminal) I'm getting the following error

Had an error while searching!
 { [Error: IndexMissingException[[videoSearch] missing]] message: 'IndexMissingException[[videoSearch] missing]' }

what is the issue with this, anyone has idea?

Add Blaze Components for even easier searching

Components list (open for suggestions):

  • easySearchInput index="indexName" limit.. // Search input field
  • easySearchListResults index="indexName" // Loopable each for the search results of the input
  • easySearchContainer index="indexName" // A search container which uses the input and list results

filter search

Is there a way to search by multiple fields?

If (field = "xx" AND another field = "")

Collection: Meteor.users

Does this not work with Meteor.users collection ?

Meteor.startup(function () {
    // on Client and Server
    EasySearch.createSearchIndex('users', {
        'collection'    : Meteor.users,              // instanceof Meteor.Collection
        'field'         : 'profile.first_name',    // can also be an array of fields
        'port': '9300'
    });
});

I am getting client side errors of undefined collection:

function: TypeError: Cannot read property 'collection' of undefined

Using mongoDB Comparison Query Operator $ne in createSearchIndex

Hello,
is it possible to create a search index with a mongoDB comparison query operator (for instance: $ne)?

I would like to do something like this:

EasySearch.createSearchIndex('users', {
    'field' : ['username'],
    'collection' : Users,
    'limit' : 20,
    'filter' : { 'username': {$ne: Meteor.user().username} },
    'query' : function (searchString) {
        // Default query that will be used for searching
        var query = EasySearch.getSearcher('mongo-db').defaultQuery(this, searchString);
        return query;
    }
});

esInput misses keypress events

Test case: type 3 or 4 characters in the search field that yield results. Make sure that the first and second character also yield results. Now clear the field with fairly quick backspace presses.

Result: when the last character is removed the search will still yield results from the last or the last two characters depending on how fast backspace was pressed.

meteor-easy-search compatible with Meteor 0.9.1.1?

Hello,
I have just updated Meteor and now I always get this exception:

[Log] Exception from Tracker recompute function: 'undefined' is not an object (evaluating 'EasySearch.getSearcher('mongo-db').defaultQuery') (meteor.js, line 805)
query@http://localhost:3000/collections/users.js?30786421af8288cd008273243b344eb4722be77e:8:55
search@http://localhost:3000/packages/matteodem:easy-search.js?3d401d05a65552bc909d028a148b6bd49af9fe43:380:27
search@http://localhost:3000/packages/matteodem:easy-search.js?3d401d05a65552bc909d028a148b6bd49af9fe43:292:35
http://localhost:3000/packages/matteodem:easy-search.js?3d401d05a65552bc909d028a148b6bd49af9fe43:816:24
_compute@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36
Computation@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:18
autorun@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:476:34
createSearchDependency@http://localhost:3000/packages/matteodem:easy-search.js?3d401d05a65552bc909d028a148b6bd49af9fe43:813:17
http://localhost:3000/packages/matteodem:easy-search.js?3d401d05a65552bc909d028a148b6bd49af9fe43:842:29
forEach@[native code]
forEach@http://localhost:3000/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18:156:18
created@http://localhost:3000/packages/matteodem:easy-search.js?3d401d05a65552bc909d028a148b6bd49af9fe43:839:11
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:2801:24
fireCallbacks@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1814:20
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1811:24
_withCurrentView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:2017:16
_fireCallbacks@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1810:25
_createView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1828:23
_materializeView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1832:20
visitObject@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1508:44
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:116:36
doMaterialize@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1850:48
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
doRender@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1848:26
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1787:20
_withCurrentView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:2017:16
viewAutorun@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1786:34
_compute@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36
Computation@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:18
autorun@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:476:34
autorun@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1785:26
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1839:17
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
_materializeView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1838:22
visitObject@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1508:44
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:116:36
visitArray@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1412:17
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:114:37
visitTag@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1490:41
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:101:37
doMaterialize@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1850:48
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
doRender@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1848:26
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1787:20
_withCurrentView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:2017:16
viewAutorun@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1786:34
_compute@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36
Computation@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:18
autorun@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:476:34
autorun@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1785:26
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1839:17
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
_materializeView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1838:22
visitObject@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1508:44
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:116:36
visitArray@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1412:17
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:114:37
visitTag@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1490:41
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:101:37
visitArray@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1412:17
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:114:37
visitTag@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1490:41
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:101:37
visitArray@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1412:17
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:114:37
visitTag@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1490:41
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:101:37
visitArray@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1412:17
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:114:37
visitTag@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1490:41
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:101:37
visitArray@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1412:17
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:114:37
doMaterialize@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1850:48
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
doRender@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1848:26
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1787:20
_withCurrentView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:2017:16
viewAutorun@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1786:34
_compute@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36
Computation@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:18
autorun@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:476:34
autorun@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1785:26
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1839:17
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
_materializeView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1838:22
visitObject@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1508:44
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:116:36
doMaterialize@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1850:48
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
doRender@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1848:26
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1787:20
_withCurrentView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:2017:16
viewAutorun@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1786:34
_compute@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36
Computation@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:18
autorun@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:476:34
autorun@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1785:26
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1839:17
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
_materializeView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1838:22
visitObject@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1508:44
visit@http://localhost:3000/packages/htmljs.js?fcf2660be84fbc0c33b97ee8932dbd46612f3566:116:36
doMaterialize@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1850:48
nonreactive@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:502:13
doRender@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1848:26
http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1787:20
_withCurrentView@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:2017:16
viewAutorun@http://localhost:3000/packages/blaze.js?5ec4e54b22ab2196bcc772669c0619f71666393e:1786:34
_compute@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36
_recompute@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:302:22
flush@http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:430:24

Is this package compatible with the latest Meteor version?
Thanks in advance.

Searching on the server (using pub/sub)?

I'm trying to integrate this with iron-router and publication/subscribe methods.

SearchController = RouteController.extend({

    waitOn: function () {
        return Meteor.subscribe('animeSearch', this.params.q);
    },


});

I've got this in the server

Meteor.publish('animeSearch', function(query) {

    return EasySearch.search('anime',  query, {
        'limit' : 50
    });

});

I'm not actually sure what EasySearch.Search returns on the server. I'm assuming it's not a cursor since I don't have access to any of the documents on the client side.

Additionally I am wondering how I can add a value attribute to the esInput component.

For example if someone has this url /search?q=attack then I want to show the results for that in which case i'd need something in the input, in this case attack.

Limit access to index

This is not a bug report but rather a question:

What would be the best way to limit who has access to searching a given index? I tried to only define my search index on the server, but it seems that the index is still searchable on the client. Perhaps I can solve it by checking permissions in the publish method(s) for the collection(s) used for the index, but that just seems a little cumbersome.

Any ideas?

Disable case matching of search terms

Before I ask my question just wanted to thank everyone who has worked or is working on easy search.

Unless I misunderstood, I thought by default easy search did not have case matching of terms enabled.

An example is that some of the documents in my Mongodb collection have "London" in some of the fields. If I start typing "Lon" then those records will appear but if I try "lon" they will not.

Also, though I installed elastisearch I have currently implemented easy search to just use mongodb.

Thanks,

James

Incompatibility with audit-argument-checks

Hello,
Problems when you use the package "audit-argument-checks", there are errors, due to the lack of not using the function "check" on arguments to the methods :

//easy-search-server.js
[...]
Meteor.methods({
/**
* Make search possible on the client.
*
* @param {String} name
* @param {String} searchString
*/
easySearch: function (name, searchString) {
check(name, String);
check(searchString, String);
return EasySearch.search(name, searchString);
},

Can you add these methods to be compatible with the audit-argument-checks package please, and publish to Atmosphere/Meteorite ?

Filter query with mongo-db

I am trying to figure out how to use the 'query' option when creating a search index. in my example:

 EasySearch.createSearchIndex('students', {
        'collection': Meteor.users,
        'field': ['profile.first_name', 'profile.last_name'],
        'use': 'mongo-db',
        'customSearchFilter' : true,
        query: function(){
            return {roles: ['student']}
        }
    });

I wanted to in combination with the meteor-roles package filter so that I create an index and search against only users who have a particular role. I have another index which mimics the one in the README using the Meteor.users collection already working perfectly but that doesn't use a customSearchFilter, am I doing anything wrong in particular. I get no rows back, I know this query works because in the template, the exact same filter is used to display records in the case the query results are empty ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.