Comments (7)
Does it hang if run in the mongodb console? If not, does it hang if run
with just the node driver?
mongodb, node, mongoose, and plugin versions please.
On Friday, September 27, 2013, Matthew Conlen wrote:
e.g.
search: function(req, res, next) {
MyModel.textSearch(req.params.searchstring, function(err, output) {
if(err) {
console.log(err);
}
res.json(_.map(output.results, function(r) {return r.obj} ));
})
}will output no error string and never return if MyModel doesn't have any
records—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.
Aaron
@aaronheckmann https://twitter.com/#!/aaronheckmann
soundcloud.com/ajhecky
github.com/aheckmann
from mongoose-text-search.
Added the versions to the original post.
From the mongo
console:
db.modelname.runCommand("text", {search: "searchterm"})
{
"queryDebugString" : "searchterm||||||",
"language" : "english",
"results" : [ ],
"stats" : {
"nscanned" : 0,
"nscannedObjects" : 0,
"n" : 0,
"nfound" : 0,
"timeMicros" : 9281
},
"ok" : 1
}
Returns correctly. Will check using node driver
from mongoose-text-search.
I have a similar problem. No result, no error, etc... even with data in the collection.
Using the mongo cmd I get the error "too many text index for: ..", even if i don't create an index on the collection. Is there some sort of auto text index creation for mongoose?
Why is this error not passed to the callback?
from mongoose-text-search.
The problem with forever hangs is that callback function is never executed and You probably return nothing to the browser.
As far as I investigated the problem can be related with recent changes in mongodb project:
./mongodb/lib/mongodb/db.js
in:Db.prototype.command function
from mongoose-text-search.
can't reproduce this.
@frty2 yes mongoose auto-creates indexes when you call var m = mongoose.model(X, schema)
. You can listen for errors with m.on('index', callback)
.
@feaber interesting. i'm aware of some poor error swallowing behavior by the driver. not sure if its been fixed yet.
I'm going to close unless there's more to go on. If you can reliably reproduce, please submit more information or better yet, a pull request with the fix and a test.
from mongoose-text-search.
issue could be that the text search isn't enabled on your mongo.. Wasn't on mine, and was hanging forever..
from mongoose-text-search.
Nah, it was my code :(
I was connecting / closing connection in every action.
When I test with "var db = mongoose.connect(mongo_uri);" on top of main js file, it started to work.
Looks like textSearch when is execuded had no valid connection.
The db driver will not run callback if there is no connection.
I think I have to read more about proper handling db connections in node.js :)
Regards,
Konrad.
from mongoose-text-search.
Related Issues (16)
- Support for populate HOT 3
- Supporting offset and sort options HOT 2
- Too little result HOT 1
- Does not work for MongoDB > 2.6
- text search not enabled
- mongoose-text-search is not working HOT 1
- Does this plugin supports accented chars?
- test issue 1
- Allow passing an object HOT 3
- mongoose-text-search on existing DB HOT 1
- How to skip? HOT 1
- Index document and a linked doc together HOT 1
- Pagination HOT 1
- Does not work with Mongoose 3.8.12 + Plugin setup
- Project not fully working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoose-text-search.