- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在为某些帖子建立索引和创建映射时,请使用最新版本的elasticsearch.js并尝试创建自定义路径分析器。
目标是在路径的每个段之外创建关键字。但是,开始时只是尝试使分析仪工作。
这是elasticsearch.js create_mapped_index.js,您可以在文件顶部附近看到自定义分析器:
var client = require('./connection.js');
client.indices.create({
index: "wcm-posts",
body: {
"settings": {
"analysis": {
"analyzer": {
"wcm_path_analyzer": {
"tokenizer": "wcm_path_tokenizer",
"type": "custom"
}
},
"tokenizer": {
"wcm_path_tokenizer": {
"type": "pattern",
"pattern": "/"
}
}
}
},
"mappings": {
"post": {
"properties": {
"id": { "type": "string", "index": "not_analyzed" },
"titles": {
"type": "object",
"properties": {
"main": { "type": "string" },
"subtitle": { "type": "string" },
"alternate": { "type": "string" },
"concise": { "type": "string" },
"seo": { "type": "string" }
}
},
"tags": {
"properties": {
"id": { "type": "string", "index": "not_analyzed" },
"name": { "type": "string", "index": "not_analyzed" },
"slug": { "type": "string" }
},
},
"main_taxonomies": {
"properties": {
"id": { "type": "string", "index": "not_analyzed" },
"name": { "type": "string", "index": "not_analyzed" },
"slug": { "type": "string", "index": "not_analyzed" },
"path": { "type": "string", "index": "wcm_path_analyzer" }
},
},
"categories": {
"properties": {
"id": { "type": "string", "index": "not_analyzed" },
"name": { "type": "string", "index": "not_analyzed" },
"slug": { "type": "string", "index": "not_analyzed" },
"path": { "type": "string", "index": "wcm_path_analyzer" }
},
},
"content_elements": {
"dynamic": "true",
"type": "nested",
"properties": {
"content": { "type": "string" }
}
}
}
}
}
}
}, function (err, resp, respcode) {
console.log(err, resp, respcode);
});
response: '{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"wrong value for index [wcm_path_analyzer] for field [path]"}],"type":"mapper_parsing_exception","reason":"Failed to parse mapping [post]: wrong value for index [wcm_path_analyzer] for field [path]","caused_by":{"type":"mapper_parsing_exception","reason":"wrong value for index [wcm_path_analyzer] for field [path]"}},"status":400}',
toString: [Function],
toJSON: [Function] } { error:
{ root_cause: [ [Object] ],
type: 'mapper_parsing_exception',
reason: 'Failed to parse mapping [post]: wrong value for index [wcm_path_analyzer] for field [path]',
caused_by:
{ type: 'mapper_parsing_exception',
reason: 'wrong value for index [wcm_path_analyzer] for field [path]' } },
status: 400 } 400
"main_taxonomies": [
{
"id": "123",
"type": "category",
"name": "News",
"slug": "news",
"path": "/News/"
}
],
"categories": [
{
"id": "157",
"name": "Local News",
"slug": "local-news",
"path": "/News/Local News/",
"main": true
},
client.indices.putSettings({})
最佳答案
所以最终的分析器是:
var client = require('./connection.js');
client.indices.create({
index: "wcm-posts",
body: {
"settings": {
"analysis": {
"analyzer": {
"wcm_path_analyzer": {
"type" : "pattern",
"lowercase": true,
"pattern": "/"
}
}
}
},
"mappings": {
"post": {
"properties": {
"id": { "type": "string", "index": "not_analyzed" },
"client_id": { "type": "string", "index": "not_analyzed" },
"license_id": { "type": "string", "index": "not_analyzed" },
"origin_id": { "type": "string" },
...
...
"origin_slug": { "type": "string" },
"main_taxonomies_path": { "type": "string", "analyzer": "wcm_path_analyzer", "search_analyzer": "standard" },
"categories_paths": { "type": "string", "analyzer": "wcm_path_analyzer", "search_analyzer": "standard" },
"search_tags": { "type": "string" },
// See the custom analyzer set here --------------------------^
关于elasticsearch - 使用自定义分析器的Elasticsearch.js分析器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42179874/
我最近开始使用 Scala 编程。我正在寻找免费的 Scala 分析器。从该语言的官方网站阅读后,我找到了 YourKit ,但该程序不是免费的。 谷歌搜索“scala profiler”没有给我任何
是否有一个程序可以让我获得有关脚本的详细信息:具体来说,我希望能够跟踪其内存占用情况并查看内存中有多少对象。 Firebug 有一个分析器,似乎可以提供计时信息,但我对内存管理更感兴趣。 最佳答案 G
Erlang 有没有好的代码分析器/分析器?我需要一些可以为我的代码构建调用图的东西。 最佳答案 对于静态代码分析,您有 Xref和 Dialyzer ,对于分析,您可以使用 cprof、fprof
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
什么是“self”和“total”列? “总计”列加起来不等于 100%(高得多),看起来像 self 一样。我怀疑 self 是非累积的,而 total 是。因此,如果 methodA 调用 met
在 Perl 中,有一个非常好的分析器,称为 NYTProf。 在其报告中包含 flame graph ,这样就很容易找到程序的瓶颈 是否有一个等效的 java profiler 可以生成相同的报告?
我想知道是否有办法在c++程序中查看特定部分的调用路径。我在开源代码中工作,其中包含许多库。我尝试按照最终在模板中的路径中的代码进行操作。那么,是否有这样的库或分析器来显示代码特定部分的调用路径? 谢
我正在寻找支持每个请求分析统计的分析器,最好是沿着程序流(而不是通常的线程调用堆栈)。所以基本上是每个请求的探查器调用堆栈 + 顺序调用 View ,如下所示: doGet
如何让 symfony profiler 在 phpstorm 中工作?它应该在状态栏中,但是当我打开那个窗口时,它总是说:“这里什么都没有”。缓存目录在配置中正确定义,symfony 插件本身工作正
人们在 Unix 中用来解析/分析日志文件的流行工具是什么?进行计数,查找唯一性,选择/复制具有特定模式的特定行。请提供一些工具或一些关键字。因为我相信以前肯定有类似的问题,但我对关键字一无所知。谢谢
我设置了一个过滤器来计算执行的查询数量,并在超过某个限制时将一些内容写入我的数据库。 它在我的开发环境中运行良好,但是当我在生产环境中测试它时,我的数据库不再返回分析器。我认为这是一个为开发环境启用数
你找到这样的工具并成功使用了吗? 最佳答案 我也在寻找 AS 的分析器,但我想要一个与 FlashDevelop 和 Flex SDK 配合使用的免费软件/开源解决方案。我没有找到。所以我写了一个简单
我需要扩展 SonarQube,以便我可以向其中添加新的分析器。我尝试使用 xpath 为 java 文件添加新规则。我想知道如何在 SonarQube 中添加新语言的代码分析器,例如对于 .meta
我可以在C#(嵌套)中使用elasticsearch 2.3.0版本 我想将分析与索引一起使用, 但是索引设置不会改变,我也不知道为什么。 这是我的代码: private void b
我有一个正在wireshark中查看的自定义协议(protocol)。我认为如果wireshark可以帮我剖析它,这样我就不必解码十六进制了,这会很有用。尽管我在程序日志中执行此操作,但wiresha
我正在考虑使用 Elasticsearch 来提供我们网站的搜索功能。 我一直在试验它,但无法启用 Porterstem 分析器(以便搜索战斗匹配战斗和战斗)。 这是我输入的摘要。 curl
我正在尝试运行一个基于java的java分析器来找出我的专用机器上的java应用程序的资源消耗情况。我尝试使用的分析器称为 Warmroast。 运行时出现以下错误。 java -jar warmro
我没有从我的分析器获得预期结果,并且想测试标记化过程。 此问题的答案:How to use a Lucene Analyzer to tokenize a String? List result =
我在 Lucene 中有特殊的分析需求,但我想继续使用 StandardAnalyzer 机制的部分内容。 特别是,我想要字符串 “-苹果--胡萝卜-番茄?” 被标记为: “-苹果-”2.“-胡萝卜-
有什么好的 JSF 分析器推荐吗? 我正在使用 Tomcat 6 JSF2、 hibernate 和 Spring 最佳答案 如果您使用的是 Eclipse 或 Netbeans 之类的 IDE,那么
我是一名优秀的程序员,十分优秀!