diff --git a/elasticsearch/schemas/products_jp.json b/src/amazon-product-search/elasticsearch/schemas/products_jp.json similarity index 100% rename from elasticsearch/schemas/products_jp.json rename to src/amazon-product-search/elasticsearch/schemas/products_jp.json diff --git a/elasticsearch/schemas/products_us.json b/src/amazon-product-search/elasticsearch/schemas/products_us.json similarity index 100% rename from elasticsearch/schemas/products_us.json rename to src/amazon-product-search/elasticsearch/schemas/products_us.json diff --git a/src/amazon-product-search/src/amazon_product_search/indexing/transforms/filters.py b/src/amazon-product-search/src/amazon_product_search/indexing/transforms/filters.py index b8b300f7..c87926eb 100644 --- a/src/amazon-product-search/src/amazon_product_search/indexing/transforms/filters.py +++ b/src/amazon-product-search/src/amazon_product_search/indexing/transforms/filters.py @@ -10,8 +10,4 @@ def is_indexable(product: Dict[str, Any]) -> bool: Returns: bool: A flag indicating whether the pipeline will index the doc. """ - if product is None: - return False - if "product_title" not in product: - return False - return product["product_title"] + return bool(product.get("product_title")) diff --git a/src/amazon-product-search/tasks/es_tasks.py b/src/amazon-product-search/tasks/es_tasks.py index a2eef822..60926158 100644 --- a/src/amazon-product-search/tasks/es_tasks.py +++ b/src/amazon-product-search/tasks/es_tasks.py @@ -1,10 +1,10 @@ import contextlib +from elasticsearch import NotFoundError from invoke import task from amazon_product_search.constants import HF from amazon_product_search.core.es.es_client import EsClient -from elasticsearch import NotFoundError @task diff --git a/vespa/hosts.xml b/src/amazon-product-search/vespa/hosts.xml similarity index 100% rename from vespa/hosts.xml rename to src/amazon-product-search/vespa/hosts.xml diff --git a/vespa/models/.gitignore b/src/amazon-product-search/vespa/models/.gitignore similarity index 100% rename from vespa/models/.gitignore rename to src/amazon-product-search/vespa/models/.gitignore diff --git a/vespa/schemas/product.sd b/src/amazon-product-search/vespa/schemas/product.sd similarity index 100% rename from vespa/schemas/product.sd rename to src/amazon-product-search/vespa/schemas/product.sd diff --git a/vespa/search/query-profiles/default.xml b/src/amazon-product-search/vespa/search/query-profiles/default.xml similarity index 100% rename from vespa/search/query-profiles/default.xml rename to src/amazon-product-search/vespa/search/query-profiles/default.xml diff --git a/vespa/search/query-profiles/types/root.xml b/src/amazon-product-search/vespa/search/query-profiles/types/root.xml similarity index 100% rename from vespa/search/query-profiles/types/root.xml rename to src/amazon-product-search/vespa/search/query-profiles/types/root.xml diff --git a/vespa/services.xml b/src/amazon-product-search/vespa/services.xml similarity index 100% rename from vespa/services.xml rename to src/amazon-product-search/vespa/services.xml