我有这个文件
{
"text_foo": "lorem ipsum",
"one":{
"two":{
"three":{
"text_bar": "dolor sit amet"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
我想要完成的事情:我需要动态模板,它将匹配以“text_”开头的任何属性示例:
"mappings" : {
"dynamic_templates":[
{
"text":{
"match": "text_*",
"path_match": "*.text_*",
"match_mapping_type": "*",
"mapping":{"type":"text","analyzer":"myCustomAnalyzer"}
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
"match"和可以"path_match"一起使用吗?(就像我的例子一样)
会"path_match":"*.text_*"匹配整个路径"one.two.three.text_*"还是仅匹配“one.text_*”?
也会"path_match":"*.text_*"匹配 root 属性吗"text_foo"?
如果唯一的解决方案是使用正则表达式 ( "match_pattern":"regex"),则正则表达式将匹配整个路径"one.two.three.text_bar"还是仅匹配"text_bar"?
mapping elasticsearch elasticsearch-mapping elasticsearch-template
为了这篇文章的目的,我创建了一个简单的示例: http://wagoon.demoeshop.net/test-remove-vue.html
在此示例中,您会发现两个按钮。
DIV元素,然后创建一个 Vue 应用程序并将其安装到该应用程序div在我的示例中,您会发现两个按钮
<button type="button" onclick="myTest.mount()">.mount()</button>
<button type="button" onclick="myTest.unmount()">.unmount()</button>
Run Code Online (Sandbox Code Playgroud)
包含 Vue.js 3
<script src="https://unpkg.com/vue@next"></script>
Run Code Online (Sandbox Code Playgroud)
testClass()出于调试原因,整个 javascript 代码都包装在函数中:
function testClass(){
// vueApp is public just for debugging reasons
this.vueApp = null;
// creates DIV with id #appDiv and apends it to <body>
function createDiv(){
var div = document.createElement('div');
div.id = "appDiv";
document.body.append(div);
}
// creates new Vue app and mounts it to #appDiv
this.mount = function(){
createDiv();
this.vueApp = Vue.createApp({"template":"Vue mounted"}); …Run Code Online (Sandbox Code Playgroud)