Skip to content

Instantly share code, notes, and snippets.

View NZhuravlev's full-sized avatar

Nikita Zhuravlev NZhuravlev

  • AutoScout24
  • Munich
View GitHub Profile

Taxonomy Redirect Resolution — How It Works

When taxonomy dimensions are retired (e.g., a motor type is split into two, a trim is reclassified), users searching for old cat values get redirected to the current ones.

Concepts

  • Category (cat): a combination of dimensions like ma13gr100037mt1314 (make=BMW, modelGroup=1 Series, motorType=M135)
  • Rule: maps a retired dimension value to its replacement(s). Example: motor type "M135" (id 1314) → "1er M" (id 903)
  • Patch: what a rule produces — the new dimension values to apply
class Solution {
// temp: input array
// n: size of array
//Function to rearrange the array elements alternately.
public static void rearrange(int arr[], int n){
for (int i = 0; i < arr.length; i++) {
int index = i;
int next = arr[index];
if (next < 0) continue;
class Timer {
long startTime = System.currentTimeMillis()
static Timer start() {
new Timer()
}
long timeSpent() {
System.currentTimeMillis() - startTime
}
package com.doublescoring.socredit
class Customer {
List<Order> orders;
}
class Order {
List<String> products;
}
package com.doublescoring.socredit;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class Test {
public static void main(String[] args) {
int size = Arrays.asList(new OrderList(Arrays.asList(new Order(Arrays.asList("гавно", "шлак")))))
.stream()
package com.doublescoring.socredit.domain;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Event {
private ExecutorService executor = Executors.newCachedThreadPool();
private Runnable errorHandler;
private Runnable successHandler;
private final Object lock = new Object();