如何在python中使用mongoengine在StringField的ListField上创建索引?

问题描述

我有一个博客模型,想要在标题内容标签字段上实现文本搜索功能。这是代码

fatal: [tst01]: Failed! => {
    "changed": false,"module_stderr": "Exception calling \"Create\" with \"1\" argument(s): \"At line:4 char:21\r\n+ def _ansiballz_main():\r\n+                     ~\r\nAn expression was expected after '('.\r\nAt line:13 char:27\r\n+     except (AttributeError,OSError):\r\n+                           ~\r\nMissing argument in parameter list.\r\nAt line:15 char:7\r\n+     if scriptdir is not None:\r\n+       ~\r\nMissing '(' after 'if' in if statement.\r\nAt line:22 char:7\r\n+     if sys.version_info < (3,):\r\n+       ~\r\nMissing '(' after 'if' in if statement.\r\nAt line:22 char:30\r\n+     if sys.version_info < (3,):\r\n+                              ~\r\nMissing expression after ','.\r\nAt line:22 char:25\r\n+     if sys.version_info < (3,):\r\n+                         ~\r\nThe '<' operator is reserved for future use.\r\nAt line:27 char:34\r\n+     def invoke_module(modlib_path,temp_path,json_params):\r\n+                                  ~\r\nMissing argument in parameter list.\r\nAt line:28 char:40\r\n+         z = zipfile.ZipFile(modlib_path,mode='a')\r\n+                                        ~\r\nMissing argument in parameter list.\r\nAt line:31 char:33\r\n+         zinfo = zipfile.ZipInfo()\r\n+                                 ~\r\nAn expression was expected after '('.\r\nAt line:34 char:25\r\n+         z.writestr(zinfo,sitecustomize)\r\n+                         ~\r\nMissing argument in parameter list.\r\nNot all parse errors were reported.  Correct the reported errors and try again.\"\r\nAt line:6 char:1\r\n+ $exec_wrapper = [ScriptBlock]::Create($split_parts[0])\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n    + CategoryInfo          : NotSpecified: (:) [],MethodInvocationException\r\n    + FullyQualifiedErrorId : ParseException\r\n \r\nThe expression after '&' in a pipeline element produced an object that was not valid. It must result in a command \r\nname,a script block,or a CommandInfo object.\r\nAt line:7 char:2\r\n+ &$exec_wrapper\r\n+  ~~~~~~~~~~~~~\r\n    + CategoryInfo          : InvalidOperation: (:) [],RuntimeException\r\n    + FullyQualifiedErrorId : BadExpression\r\n ","module_stdout": "","msg": "MODULE FAILURE\nSee stdout/stderr for the exact error","rc": 1
}

我知道如何在标题内容字段中添加索引,但不知道如何在ListField即标签添加索引。

我在项目中将烧瓶与mongoengine一起使用。任何建议都是非常可取的。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...