1

I'm using SolrJ (4.9.0) to handle Solr query.

Unfortunately the deletByID method doesn't work for me. It just does nothing (no error, no exceptions).

I've read the answer about the "version" field in the schema.xml but it's not my issue given that it is present.

I'd like to know if anyone is having the same problem or pheraphs if you have any idea on how to solve it.

Thanks.

laks.it
  • 165
  • 14
  • Did you commit after the delete? – arun Oct 15 '14 at 17:06
  • Yes I do. And, to answer Alexandre's comment, I use exactly the same server and collection that I use to add a new document (which works fine). – laks.it Oct 16 '14 at 07:29
  • The server URI and collection name are correct. Also the schema.xml I think is fine because if I try to delete an element using `http://localhost:8983/solr/update?stream.body= id:MY_ID&commit=true` it works. I'm using Jetty 9.2.2 – laks.it Oct 16 '14 at 08:03
  • Using the deleteByQuery("id:MY_ID") everything works fine. Can't get what's the problem. I'll use this workaround for the moment. – laks.it Oct 16 '14 at 08:11
  • See http://stackoverflow.com/a/2753772/1333610 – arun Oct 16 '14 at 12:11

1 Answers1

0

There is three main possible issues you might be hitting:

  1. Not pointing at the right collection/server or pointing at default collection when your collection is not default. Make sure you have the full URL and it has the same collection name in it as when you do the query
  2. Not committing for some reasons, you should see the commit messages in the logs
  3. Causing some sort of server-side error, again the Solr log would be complaining pretty loudly then

If the don't help, refine your question with version of Solr, the URL/method you are issuing a delete with and the way you are verifying that nothing actually changed.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27