I thought it is rather common case, but just can't figure out and find any info about it.
Say I have following texts:
- Dogs hate cats
- My cat eat mice but hate dogs
- Mice hate cats but don't care about dogs
- Giraffes don't care about any cat
- Dogs are brave in most cases
I can't figure out query, which returns texts in following order:
1) First all texts which contains ALL three 'dog', 'cat' and 'mice',
2) Then all texts which contains each pair of ('dog', 'cat'), ('dog', 'mice'), ('cat', 'mice') in no particular order
3) Then all texts which contains any of 'dog', 'cat' or 'mice'
So result of such query for given texts should be something like this (preferably shorter text first, but not necessarily)
- My cat eat mice but hate dogs
- Mice hate cats but don't care about dogs
- Dogs hate cats
- Giraffes don't care about any cat
- Dogs are brave in most cases
Could anybody help me please?