Skip to content

Instantly share code, notes, and snippets.

@SupermanScott
Created March 22, 2012 20:53
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 SupermanScott/2164332 to your computer and use it in GitHub Desktop.
Save SupermanScott/2164332 to your computer and use it in GitHub Desktop.
<?php
public function createQueryDSL($query, $skip, $limit) {
$query_json = array(
'query' => array(
'custom_filters_score' => array(
'query' => array(
'query_string' => array(
'fields' => array('title^5', 'message', 'vanity_url^3', 'full_name^5'),
'query' => $query,
'use_dis_max' => TRUE,
),
),
'filters' => array(
array('filter' => array('term' => array('user_verified' => TRUE)), 'boost' => 3.0),
),
),
),
'size' => $limit,
'from' => $skip,
);
return $query_json;
}
?>
@SupermanScott
Copy link
Author

Got it to work something like the above gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment