Skip to content

Instantly share code, notes, and snippets.

@bentedder
Created March 30, 2017 13:18
Show Gist options
  • Save bentedder/b06f9c7a7f2751d40e8f994ec2ff3fda to your computer and use it in GitHub Desktop.
Save bentedder/b06f9c7a7f2751d40e8f994ec2ff3fda to your computer and use it in GitHub Desktop.
Bool query
size: limit,
query: {
bool: {
must: {
multi_match: {
query: term,
fields: ['name', 'raw_name']
}
},
should: {
term: { user_id: current_user.id },
bool: {
must_not: {
exists: { field: 'user_id' }
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment