To request a filter in Solr, I need to include all documents of an unspecified type, as well as any documents of this type that are relevant in a specific field.
I tried this:
fq=(-type_id:(A) OR content:(['' TO *]))
But this excludes type_id B, C, etc. documents that are null content . ( type_id is the string field, and content is text .)
I saw this question: Complex SOLR query, including NOT and OR , and this post about operators: http://robotlibrarian.billdueber.com/solr-and-boolean-operators/ . I think the syntax that I have should be correct. Can anyone see my mistake?
Update: I am using LuceneQParser. It parses the filter request above as
-type_id:A content:['' TO *]
It parses the filter request suggested in the comments ( -type_id:A OR (content:[* TO *] AND type_id:A) ), as
-type_id:A (+content:[* TO *] +type_id:A)
therefore no results.
source share