Skip to content

Instantly share code, notes, and snippets.

@saihoooooooo
Last active August 29, 2015 14:22
Show Gist options
  • Save saihoooooooo/53bf237d073924892812 to your computer and use it in GitHub Desktop.
Save saihoooooooo/53bf237d073924892812 to your computer and use it in GitHub Desktop.
my solr tips
// 値引率の計算
// 値引き額(定価 - 値引き後の金額(存在しない場合は定価)) / 定価 * 100
fl=product(div(sub(price, if(exists(price_discount), price_discount, price)), price), 100)
// カテゴリAだったらseqの降順、それ以外はseqの昇順でソート
sort=if(exists(query({!v='category:A'})), product(seq, -1), product(seq, 1)) asc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment