From 3c2b5a21035ac6672b54226796f6c915cbd15eae Mon Sep 17 00:00:00 2001 From: liangliang Date: Tue, 20 Jul 2021 16:50:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0ua=E8=A7=A3=E6=9E=90=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog/documents.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blog/documents.py b/blog/documents.py index 5b55cf2..cca422b 100644 --- a/blog/documents.py +++ b/blog/documents.py @@ -14,7 +14,7 @@ import elasticsearch.client from elasticsearch_dsl.connections import connections import time from blog.models import Article -from elasticsearch_dsl import Document, InnerDoc, Date, Integer, Long, Text, Object, GeoPoint, Keyword +from elasticsearch_dsl import Document, InnerDoc, Date, Integer, Long, Text, Object, GeoPoint, Keyword, Boolean from django.conf import settings @@ -71,6 +71,7 @@ class UserAgent(InnerDoc): os = Object(UserAgentOS, required=False) device = Object(UserAgentDevice, required=False) string = Text() + is_bot = Boolean() class ElapsedTimeDocument(Document): @@ -121,6 +122,7 @@ class ElaspedTimeDocumentManager(): ua.device.Brand = useragent.device.brand ua.device.Model = useragent.device.model ua.string = useragent.ua_string + ua.is_bot = useragent.is_bot doc = ElapsedTimeDocument( meta={