Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to delete all documents? #30

Closed
jochenonline opened this issue Sep 13, 2012 · 8 comments
Closed

How to delete all documents? #30

jochenonline opened this issue Sep 13, 2012 · 8 comments

Comments

@jochenonline
Copy link
Contributor

I tried

client.deleteByQuery( "*:*", function( err, response ) {
    //....
});

but I always get

SolrError: HTTP status 404.Reason: Not Found

Also

 client.delete( "*", "*", function( err, response ) {

and

 client.delete( "id", "*", function( err, response ) {

lead to the same result!

What am I doing wrong?

@lbdremy
Copy link
Owner

lbdremy commented Sep 13, 2012

Hi,

Which version of Solr are you using?
And did you create your client correctly? Have look to the definition of the method createClient() here http://lbdremy.github.com/solr-node-client/code/solr.js.html.

@jochenonline
Copy link
Contributor Author

I am using Solr4 (beta) and I am creating the client like this (Solr running on localhost with standard port):

var solr = require('solr-client'),
    client = solr.createClient(),
    ...

I am using the same client for .add(...), .createQuery(...) and .search(...) successfully. Only deleting documents makes trouble! I had no problems deleting documents with node-solr on the same installation.

@lbdremy
Copy link
Owner

lbdremy commented Sep 13, 2012

Yes the client is not working well with Solr 4 yet, an issue has been raised #27.
If you run the test suite (without the flag mocked : true, look at test/config.json), you will see that couple of test are failing against a Solr 4 server.
Feel free to send a pull request to fix that.

@jochenonline
Copy link
Contributor Author

Any workaround possible i.e. via sending the delete command more directly to the server?

@lbdremy
Copy link
Owner

lbdremy commented Sep 13, 2012

Well the method Client.prototype.update (http://lbdremy.github.com/solr-node-client/code/solr.js.html) is used to do all the POST requests, add, delete, commit ... but the thing is the path is not configurable from there, which is probably the reason it's not working since you get HTTP 404 error, you won't be able to modify the path from any methods available using an instance of Client.

@marc-portier
Copy link
Collaborator

I just tested this : on my current v0.3.x branch versus a solr4 instance and it just passes.
So I guess we can close this off together with the v0.3.x release?

Together with #88 and #27 that would mean we have all outstanding solr4 labeled issues covered in v0.3.x

@lbdremy
Copy link
Owner

lbdremy commented Jul 28, 2014

Ok I suppose yes

@lbdremy
Copy link
Owner

lbdremy commented Aug 16, 2014

Landed on npm

@lbdremy lbdremy closed this as completed Aug 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants