my personal website at http://matteodem.ch
matteodem / easy-search-leaderboard Goto Github PK
View Code? Open in Web Editor NEWOne of the meteorjs examples enhanced with the easy-search package
One of the meteorjs examples enhanced with the easy-search package
my personal website at http://matteodem.ch
is it possible to use Mongo and ES in the same meteor application?
Whenever you type something that returns no results if you then delete your characters in search field the full list does not return. Only way to get back to full list is to give someone points or refresh the page... Basically if the search string is empty again it show full set again...
As soon as I put the createSearchIndex code in the app.js that is sitting in my project root, I get the following error:
W20140319-12:27:29.732(-4)? (STDERR)
W20140319-12:27:29.732(-4)? (STDERR) events.js:72
W20140319-12:27:29.733(-4)? (STDERR) throw er; // Unhandled 'error' event
W20140319-12:27:29.733(-4)? (STDERR) ^
W20140319-12:27:29.733(-4)? (STDERR) Error: connect ECONNREFUSED
W20140319-12:27:29.733(-4)? (STDERR) at errnoException (net.js:901:11)
W20140319-12:27:29.733(-4)? (STDERR) at Object.afterConnect as oncomplete
=> Exited with code: 8
Any idea?
Add an ability to change sorting by First name, Last name or score in the head of each column
To provide a good example of how to work with the account system + EasySearch
I'm getting the following error "Uncaught TypeError: _easySearch.MongoDBEngine is not a constructor"
Here is my code, not sure what is wrong. Based on the docs/example
import { Profiles, Roles} from '/imports/api/collections';
import { Index, MongoDBEngine } from 'meteor/easy:search'
export const ProfilesIndex = new Index({
engine: new MongoDBEngine({
sort: function () {
return { name: -1 };
}
}),
collection: Profiles,
fields: ['name'],
defaultSearchOptions: {
limit: 10
},
permission: () => {
//console.log(Meteor.userId());
return true;
}
});
I added a players score to the search config but Easy Search is returning no results. I only changed the config to the following, am I missing something?
// Searching
Meteor.startup(function () {
// on Client and Server
EasySearch.createSearchIndex('players', {
'collection' : Players, // instanceof Meteor.Collection
'field' : ['name', 'score'], // can also be an array of fields
'limit' : 20, // default: 10
'use' : 'mongo-db'
});
});
I am getting an error, while I try to create an index in a separate indexes.js file.
The exact line where I create an index causes the error.
The exact error is as follows:
match.js:42 Uncaught
errorClass {message: "Match error: Expected Collection", path: "", sanitizedError: errorClass, errorType: "Match.Error", stack: "Error: Match error: Expected Collection↵ at che…c9cbd8d132b04d4a012690341aa7e009ee6d5cd8:5367:14)"}
errorType: "Match.Error"
message:"Match error: Expected Collection"
path:""
sanitizedError:errorClass
details:undefinederror:400
errorType:"Meteor.Error"
isClientSafe:true
message:"Match failed [400]"
reason:"Match failed"
stack:"Error: Match failed [400]↵ at errorClass.<anonymous> (http://localhost:3000/packages/check.js?hash=7d8a6e550ea7ab9936e21a2d9bb76f12882fb043:142:27)↵ at new errorClass (http://localhost:3000/packages/meteor.js?hash=c9a34f92f28ede5a42eac467d3fa1763b624436a:626:17)↵ at check (http://localhost:3000/packages/check.js?hash=7d8a6e550ea7ab9936e21a2d9bb76f12882fb043:89:15)↵ at Index (http://localhost:3000/packages/easysearch_core.js?hash=3bdd42bdedfe50655b11d30e03ec30263f50dd6e:75:40)↵ at new Index (http://localhost:3000/packages/easysearch_components.js?hash=2b6ce11740f0470992d652b361df53fa0268bbf0:530:31)↵ at indexes.js (http://localhost:3000/app/app.js?hash=c9cbd8d132b04d4a012690341aa7e009ee6d5cd8:5013:22)↵ at fileEvaluate (http://localhost:3000/packages/modules-runtime.js?hash=9f9bb5e055614ddf4eb3e743737b7a5b3cfd9d34:353:9)↵ at require (http://localhost:3000/packages/modules-runtime.js?hash=9f9bb5e055614ddf4eb3e743737b7a5b3cfd9d34:248:16)↵ at company-search-trial.jsx (http://localhost:3000/app/app.js?hash=c9cbd8d132b04d4a012690341aa7e009ee6d5cd8:4010:14)↵ at fileEvaluate (http://localhost:3000/packages/modules-runtime.js?hash=9f9bb5e055614ddf4eb3e743737b7a5b3cfd9d34:353:9)"
__proto__
:
Errorstack:"Error: Match error: Expected Collection↵ at check (http://localhost:3000/packages/check.js?hash=7d8a6e550ea7ab9936e21a2d9bb76f12882fb043:89:15)↵ at Index (http://localhost:3000/packages/easysearch_core.js?hash=3bdd42bdedfe50655b11d30e03ec30263f50dd6e:75:40)↵ at new Index (http://localhost:3000/packages/easysearch_components.js?hash=2b6ce11740f0470992d652b361df53fa0268bbf0:530:31)↵ at indexes.js (http://localhost:3000/app/app.js?hash=c9cbd8d132b04d4a012690341aa7e009ee6d5cd8:5013:22)↵ at fileEvaluate (http://localhost:3000/packages/modules-runtime.js?hash=9f9bb5e055614ddf4eb3e743737b7a5b3cfd9d34:353:9)↵ at require (http://localhost:3000/packages/modules-runtime.js?hash=9f9bb5e055614ddf4eb3e743737b7a5b3cfd9d34:248:16)↵ at company-search-trial.jsx (http://localhost:3000/app/app.js?hash=c9cbd8d132b04d4a012690341aa7e009ee6d5cd8:4010:14)↵ at fileEvaluate (http://localhost:3000/packages/modules-runtime.js?hash=9f9bb5e055614ddf4eb3e743737b7a5b3cfd9d34:353:9)↵ at require (http://localhost:3000/packages/modules-runtime.js?hash=9f9bb5e055614ddf4eb3e743737b7a5b3cfd9d34:248:16)↵ at router.jsx (http://localhost:3000/app/app.js?hash=c9cbd8d132b04d4a012690341aa7e009ee6d5cd8:5367:14)"
__proto__
:
Error
The exact line where I create an index causes the error.
import { Index, MinimongoEngine } from 'meteor/easy:search';
import Companies from './companies.js';
// On Client and Server
export const CompaniesIndex = new Index({
collection: Companies,
fields: ['name'],
engine: new MinimongoEngine()
});
I read about the similar issue, and still cant figure out what to do in order to rectify this, and that thread was closed. Hence, had to open a new issue.
Please tell me what to do in order to rectify this. Thanks.
When going into a page (let's say 10) and then choosing a player and increasing his points, he is being sorted inside the same page but not moving into the right page.
Is it the intended behaviour?
Thank you for a very good example code.
Was testing the autosuggest feature and it works fine - except the pull-down list box is getting redrawn (almost causing the page to look like it got refreshed). Wondering if that UI experience can be improved (just like google's autosuggest works, smooth rendering).
I cloned this repo with:
git clone https://github.com/matteodem/easy-search-leaderboard.git
then ran mrt install
to install the easy-search package and after running meteor
, the application always crashes with the same error.
`
=> Errors prevented startup:
While building package easy-search
:
error: couldn't read npm version lock information
=> Your application has errors. Waiting for file change.`
I have no other problems with any of the other atmosphere packages. This problem exists even with a new meteor project. Any ideas
You need to run:
meteor add random
in your command line before the example project will run.
This should be documented or better, automatically pulled in.
Do you think it would be more performant if you used an in memory collection SearchResults = new Meteor.Collection(null)
rather than storing the ids in a session
object. I find that this could be an issue with large collections being returned. What do you think?
I tried to use elastic-search as search engine in this project, I activate the 'es' part and comment the 'mongodb' part and it works, though I'm not sure about the result. Following the part that concerns:
EasySearch.createSearchIndex('players', {
'collection': Players, // instanceof Meteor.Collection
'field': ['Name'], // array of fields to be searchable
'limit': 10,
'use' : 'elastic-search',
'convertNumbers': true,
'props': {
'filteredCategory': 'All',
'sortBy': 'score'
},
'sort': function() {
return ['_score'];
}
});
We can tell that it uses a Mongodb collection called Players, how can it do the elastic search with a mongodb collection? Otherwise, I don't find where we configure the elasticsearch index and type.
I'm able to override one query parameter from the server using the example in the ducumentation.
EasySearch.search('cars', "Toyo", {
'limit' : 50 // override the 20, defined in createSearchIndex
}[, callback]);
I was wondering if it's possible to override just one query parameter (eg. query.categories
) from the server.
I have tried
EasySearch.search('cars', "Toyo", {
'limit' : 50, // override the 20, defined in createSearchIndex
'query.categories': "xyz"
}[, callback]);
with Velocity
I cloned the example but I still could not get it to run even when I set
EasySearch.createSearchIndex('players', { 'collection' : Players, // instanceof Meteor.Collection 'field' : 'name', // can also be an array of fields 'limit' : 20, // default: 10 'use' : 'mongo-db' });
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.