Search code examples
solrsolrj

How to remove documents from Solr using regular expression in delete command


I am using Solr (version 7.1.0) and have some documents in it. Each document contains 2 fields, one is a string field(F1) and other is float(F2). Now I want to delete some document from it, which are containing a specific type of URL in F1. Do I remove only those documents from Solr using some regex in delete command?
If I want to delete a document, which has value "abc" in F1 field, the command should be like:

<delete><query>F1:abc</query></delete> 

I want to use some regex here, i.e. F1:<regex> . Is it possible? Please help.


Solution

  • try this:

    <delete><query>F1:/your regex here/</query></delete>