Akeem
Akeem

Reputation: 8227

I'm trying to do a solr search such that results are shown if a certain field has ANY value

I'm running a search with a type field. I'd like to show results of a certain type ONLY if two other field have values for them. So in my filter query I thought it would be(type:sometype AND field1:* AND field2:*) but wildcard queries can't start with the *.

Upvotes: 1

Views: 157

Answers (1)

Mauricio Scheffer
Mauricio Scheffer

Reputation: 99730

Use a range query to express "field must have any value", e.g.:

type:sometype AND field1:[* TO *] AND field2:[* TO *]

Upvotes: 3

Related Questions