: I want to execute the following query: : (spacegroupID:g*) OR (!userID:g*).
First: "!" is not a negation operator in the lucene/solr query parser.... : In above syntax (!userID:g*) gives results correctly. ...i don't think it's doing what you think it's doing. second: boolean queries can't be purely negative. they need to select something. the second clause of your main query is a boolean query with a single negative clause. try this instead... spacegroupID:g* (*:* -userID:g*) ...that will match any doc with a spacegroupId starting with the g character OR: any doc, except those with userID starting with the g character -Hoss