I want to be able to find items where a certain user has not rated the
item. I have tried using NOT, but it finds anything rated by anybody else,
regardless of whether the specific user has rated it. I can't seem to
figure out how to use a MISSING filter either. Here is what I have tried:
Is there another way I haven't thought of to craft a filter like this? Or
do I need to index my data differently to support this type of filtering?
Thanks for any help!
You were close. You just had the "nested" and "not" filters in the wrong order, basically.
Your (first) query says "return items that have a rating with 'ratings.rater_username' not equal to 'user1'". And so you get the first item, since it meets that requirement.
What you really want to say is "return items for which all ratings have 'ratings.rater_username' not equal to 'user1'". Here is the query you want:
You were close. You just had the "nested" and "not" filters in the wrong
order, basically.
Your (first) query says "return items that have a rating with
'ratings.rater_username' not equal to 'user1'". And so you get the first
item, since it meets that requirement.
What you really want to say is "return items for which all ratings have
'ratings.rater_username' not equal to 'user1'". Here is the query you want:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.