2

I'm using elastic and trying to find all document that doesn't contain some string.

I found out that I can do it with the regex .*string.* and use "must_not" query. but I really don't want to use it.

Is there another way? Thanks

3
  • For a better answer: describe why you do not want the solution you found so far Commented Jul 5, 2015 at 18:43
  • the query is very complicated and already nested 6 and even 7 times, so i don't wan't to make it more complicated than it is. Commented Jul 5, 2015 at 18:47
  • And what stops you from using a must_not with a match or term in it? Commented Jul 6, 2015 at 4:07

1 Answer 1

4

Complement ~ with ALL flags should do it.

Something like .*~string.

Read more here

Sign up to request clarification or add additional context in comments.

1 Comment

@EranPinhas glad i could be of some help :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.