feat:更新elastic模块

This commit is contained in:
2025-09-25 00:08:28 +08:00
parent ef938e6d97
commit 734cd6e82a
6 changed files with 70 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
from datetime import datetime
from typing import Optional
from typing import Optional, Union
from pydantic import BaseModel
@@ -9,12 +9,14 @@ class BlogElastic(BaseModel):
title: str
content: str
category: str
createTime: Optional[Union[datetime, str]] = None
updateTime: Optional[Union[datetime, str]] = None
BLOG_MAPPING = {
"mappings": {
"properties": {
"id": {"type": "integer"},
"id": {"type": "long"},
"title": {
"type": "text",
"analyzer": "ik_max_word",