On Tue, Dec 2, 2008 at 9:29 PM, Jake Conk <[EMAIL PROTECTED]> wrote:
> I am trying to exclude certain records from my search results in my
> query by specifying which ones I don't want back but its not working
> as expected. Here is my query:
>
> +message:test AND (-thread_id:123 OR -thread_id:456 OR -thread_id:789)

Lucene needs a positive component in boolean queries to match anything
(Solr only lifts this restriction for the top level queries).

So try
+message:test -thread_id:123 OR -thread_id:456 OR -thread_id:789
OR
+message:test AND (*:* -thread_id:123 OR -thread_id:456 OR -thread_id:789)

-Yonik

> So basically I just want anything back that has the word "test"
> anywhere in the message text field and does not contain the thread id
> 123, 456, or 789.
>
> When I execute that query I get no results back. When I just execute
> +message:test then I get results back and some of them with the thread
> ids I listed above but when I try to exclude them like that it doesn't
> work.
>
> Anyone have any idea how do I fix this?
>
> Thanks,
>
> - Jake C.
>

Reply via email to