Skip to content

Instantly share code, notes, and snippets.

@bentedder
Created March 30, 2017 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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