sajov / sails-solr Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED - Solr adapter for Sails.js and Waterline
DEPRECATED - Solr adapter for Sails.js and Waterline
Hi, I have an error when I start sails project.
Consistency violation: A model (users
) references a datastore which cannot be found (solrConnectionOne
). If this model definition has an explicit connection
property, check that it is spelled correctly. If not, check your default connection
(usually located in config/models.js
). Finally, check that this connection (solrConnectionOne
) is valid as per http://sailsjs.org/documentation/reference/configuration/sails-config-connections.
Model.js
module.exports.models = { connection: 'solrConnectionOne', };
Connection.js
solrConnectionOne: { module : 'sails-solr', host: 'localhost', port: 8983, core: 'schemaless', schema: true, migrate: 'drop' }
User.js
`var bcrypt = require('bcrypt');
module.exports = {
attributes: {
email: {
type: 'email',
required: true,
unique: true
},
phone: {
type: 'string',
required: true,
unique: true
},
password: {
type: 'string',
minLength: 6,
required: true
},
lastname: {
type: 'string'
},
firstname: {
type: 'string'
},
bitrhDate: {
type: 'date'
},
level: {
type: 'integer',
defaultsTo: 0
},
toJSON: function() {
var obj = this.toObject();
delete obj.password;
return obj;
}
},
beforeCreate: function(user, cb) {
bcrypt.genSalt(10, function(err, salt) {
bcrypt.hash(user.password, salt, function(err, hash) {
if (err) {
console.log(err);
cb(err);
} else {
user.password = hash;
cb();
}
});
});
}
};
`
var client = Model.getClient();
To build custom request and give the full schema and config API access
Adapter should internal handle locale prefix (dynamic fields)
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.