Skip to content

Instantly share code, notes, and snippets.

Avatar
🐙
something completely different

Alex wakawaka54

🐙
something completely different
View GitHub Profile
@wakawaka54
wakawaka54 / AffiliateInformationProvider.java
Created Feb 25, 2019
Dynamic AliExpress Affiliate Link
View AffiliateInformationProvider.java
@Slf4j
public class AffiliateInformationProvider {
private final static String AFFILIATE_BASE_URL = "http://s.click.aliexpress.com/deep_link.htm";
private final static String AFFILIATE_SHORT_KEY = "YOUR_SHORT_KEY";
public String getAffiliateUrl(String detailUrl) {
URL url = UrlBuilder.fromString(AFFILIATE_BASE_URL)
.addParameter("dl_target_url", detailUrl)
.addParameter("aff_short_key", AFFILIATE_SHORT_KEY)
View mapping-products.json
{
"products": {
"mappings": {
"item": {
"dynamic_templates": [
{
"stringSort": {
"path_match": "stringSort.*",
"mapping": {
"type": "keyword"
@wakawaka54
wakawaka54 / QueryProfile.json
Created Jan 13, 2019
Elasticsearch Query Profile
View QueryProfile.json
"profile": {
"shards": [
{
"id": "[Et56u6N-RBusw0uf0BnpUQ][products][2]",
"searches": [
{
"query": [
{
"type": "BooleanQuery",
"description": "+searchData.fullText:drone #numberSort.totalGrossPrice:[1.0 TO 1500.0] #numberSort.lotSize:[1.0 TO 10.0] #numberSort.orders:[10.0 TO 1.0E7] #numberSort.ratings:[4.0 TO 5.0]",
View gist:d4cad864d858efc41a0b2806ea0041b4
{
"from" : 0,
"size" : 25,
"profile": true,
"query" : {
"bool" : {
"must" : [
{
"match" : {
"searchData.fullText" : {