diff --git a/api/result_formatter.py b/api/result_formatter.py index 2300325..936bb0a 100644 --- a/api/result_formatter.py +++ b/api/result_formatter.py @@ -184,7 +184,7 @@ class ResultFormatter: filter_field = 'option2_value' elif option3_name and option3_name.lower() == dimension_lower: filter_field = 'option3_value' - + # If no matching field found, return all SKUs (no filtering) if not filter_field: return skus diff --git a/docs/常用查询 - ES.md b/docs/常用查询 - ES.md index 2c9c0fe..036da29 100644 --- a/docs/常用查询 - ES.md +++ b/docs/常用查询 - ES.md @@ -17,4 +17,19 @@ curl -u 'essa:4hOaLaf41y2VuI8y' -X GET 'http://localhost:9200/search_products/ ] } } - }' \ No newline at end of file + }' + + + +curl -u 'essa:4hOaLaf41y2VuI8y' -X GET 'http://localhost:9200/search_products/_search?pretty' -H 'Content-Type: application/json' -d '{ + "size": 5, + "query": { + "bool": { + "filter": [ + { "term": { "spu_id": "74123" } } + ] + } + } + }' + + diff --git a/frontend/index.html b/frontend/index.html index bcb736c..5d579f7 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -25,6 +25,10 @@ +
SearchEngine © 2025 | API: Loading...
- +