Skip to content

Instantly share code, notes, and snippets.

View ilirhushi's full-sized avatar
Working

Ilir Hushi ilirhushi

Working
View GitHub Profile
@ilirhushi
ilirhushi / es-mcf.json
Last active March 25, 2019 17:14
Elastic Search - JSON structure to filter best matching Candidate from Characters
{
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"match": {
"criteria.criteriaId": "7IC1m5neYb3RicUIrmUV"
SELECT
YEAR(stock_status_histories.created_at) as year,
MONTH(stock_status_histories.created_at) as month,
-- Total IGOR Amount Dresses
CAST(SUM(
CASE
WHEN manufacturers.id = 1 AND products.type = 'wedding_dress' OR products.type = 'evening_dress' THEN IFNULL(stock_payment_items.amount / 100, 0)
ELSE 0
END