Skip to content

Instantly share code, notes, and snippets.

View wakawaka54's full-sized avatar
🐙
something completely different

Alex wakawaka54

🐙
something completely different
View GitHub Profile
@wakawaka54
wakawaka54 / AffiliateInformationProvider.java
Created February 25, 2019 19:26
Dynamic AliExpress Affiliate Link
@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)
@wakawaka54
wakawaka54 / mapping-products.json
Created January 13, 2019 16:11
ElasticsearchMapping
{
"products": {
"mappings": {
"item": {
"dynamic_templates": [
{
"stringSort": {
"path_match": "stringSort.*",
"mapping": {
"type": "keyword"
@wakawaka54
wakawaka54 / QueryProfile.json
Created January 13, 2019 07:33
Elasticsearch Query Profile
"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]",
{
"from" : 0,
"size" : 25,
"profile": true,
"query" : {
"bool" : {
"must" : [
{
"match" : {
"searchData.fullText" : {