- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在一个项目中使用我的过滤器,每当用户点击它时,他都会得到与他/她的文本匹配的所有评论(单词)
我自己的文档如下:
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f301d2783cfcb1f016db3e2",
"_score": 28.848064,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "2-year old sleeping peacefully 😴 ",
"mood": 2
}
}
这些是我得到的结果:-
{
"took": 31,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 36,
"relation": "eq"
},
"max_score": 28.848064,
"hits": [
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f301d2783cfcb1f016db3e2",
"_score": 28.848064,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "2-year old sleeping peacefully 😴 ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f2ff43673a23c19f93f3f83",
"_score": 8.229242,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "when wake find 5 year old slipped bed ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f2ffc6f632e0a21335f34d2",
"_score": 5.6028643,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "view grandmother’s old house. ❤️ ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30b258a7c85000ec438473",
"_score": 5.6028643,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "streets old Quebec City. 😍 ",
"mood": 5
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f3001608007db1d155f9222",
"_score": 5.5635624,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "dog laying floor sleeping peacefully it’s view little world s bd grateful it. ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30d0466b4cf850f909f342",
"_score": 5.0614862,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "daughters sleeping beds 😻 ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30077d93afb8280769fae2",
"_score": 5.056673,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "beach sunny, cold day. ",
"mood": 0
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30c2d56b7f9d4117391f03",
"_score": 4.938582,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "view children sleeping. ",
"mood": 1
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30dbf67fc599245178ed02",
"_score": 4.931981,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "sleeping puppies kittens. ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f300fc438bbba64136cd442",
"_score": 4.6257343,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "back deck looking lake. Never gets old. ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f3003454d2bcf78c37246e2",
"_score": 4.43775,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "out window, through 2 columns HDB buildings. ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30547f2242bf327e522f62",
"_score": 4.2923875,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "seeing daughter happy! ",
"mood": 0
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f3008be88705c67ba1b2be2",
"_score": 4.133784,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "peaceful landscapes mountains, cool, urban cityscape ",
"mood": 0
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f3037d7c7521c22011e5f52",
"_score": 3.879126,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "walking Disney World Park every 2-3 years when go. big thunder lightning rain storm. ",
"mood": 0
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f2ff9795d4acf75f1130c62",
"_score": 3.732638,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "mountain overlook near home. ",
"mood": 1
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30b70b385cb141027b0392",
"_score": 3.6982667,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "seeing family together ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f300b0c5947d73b2f1f2042",
"_score": 3.4434087,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "Something peaceful blue sky ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f3045a0b64c7079e870eb83",
"_score": 3.2923517,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "nature . really enjoy seeing different kinds beauty nature provides ",
"mood": 0
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30ad854091a30e3748fdc3",
"_score": 3.2879872,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "seeing family happy ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f2ffa503f71da190151b6e3",
"_score": 3.2355409,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "standing top Primrose Hill seeing over London😍 ",
"mood": 0
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f309d55495425347e669c72",
"_score": 3.1025603,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "seeing joy faces ones love. ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f306a8f1e484142ff160182",
"_score": 2.9667428,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "beach, anything calming makes feel peaceful inspired ",
"mood": 1
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f3047beaf93087d444c9522",
"_score": 2.8672628,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "deep night sky, ocean waves, desert canyons... I've got year big tree outside Brooklyn window birdwatching least! ",
"mood": 5
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f2ff9b8d29c5168616b02a2",
"_score": 2.7855852,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "waking seeing fiancé's sleepy face. ♡ ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f302f57c182084e3c52af43",
"_score": 2.7658296,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "very thankful life .i peaceful soul .i come here spreading love happiness.i want anything people. ",
"mood": 0
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f2ff3c74e317d52562f5fe2",
"_score": 2.3884435,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "looking over balcony seeing nice blue ocean ",
"mood": 4
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f2ff4b38c9d562a32727532",
"_score": 2.2355409,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "seeing smile back me💯🔥🔥🔥 ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f303089c86120678e40dff2",
"_score": 2.2118597,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "looking out over city night seeing all lights cars buildings ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f300cc1ac527721047cc773",
"_score": 2.2118597,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "light rain pouring down mixed thunderstorms seeing view window <3 ",
"mood": 6
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f306a2e55389a57b969edb2",
"_score": 1.9858739,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "nice sunset. usually walk park near house whenever bored, sit grass front beautiful pond. Suchaniceview ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f310e5fe992803f2556f732",
"_score": 1.8445822,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "favourite view view sea when it's sunset. feels calm peaceful eyes see such beautiful scene ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f3013471241a213832e3392",
"_score": 1.8249211,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "view mountains, forest, apple orchard mom's front porch upstate NY. Sometimes there bears, turkey, deer. peaceful! ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f302325a082044a4b271642",
"_score": 1.7797891,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "site seeing nature....*I wrote wanted read other beautiful halohas 😁♥️* ",
"mood": 3
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f307297bec4a071590739b2",
"_score": 1.6909387,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "Vacation:the ocean, now-destroyed deck Hurricane Dorian, Hopetown, Elbow Cay, Bahamas. Home view woods - serene peaceful. ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30a16bfd669a03a227f6f3",
"_score": 1.5437499,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "view airplane when really high view seeing all things see everyday different view ✈️✈ ",
"mood": 2
}
},
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30485d9dcac5290736fff2",
"_score": 1.1237957,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "bedroom windows (my bedroom attic) sunset clear night sky. Also view bathroom while shower morning 🌌 ",
"mood": 2
}
}
]
}
}
当我通过查询获取结果时,它会给我上面给出的所有 3 个结果。
{
"query": {
"bool": {
"filter": [
{
"match": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a"
}
}
],
"must": [
{
"match": {
"text": {
"query": "passing smile each other ",
"fuzziness": "auto"
}
}
}
],
"should": [
{
"term": {
"mood": {
"value": 0
}
}
}
]
}
}
}
在结果中,如果您看到第 12 号文件是
{
"_index": "halohas",
"_type": "haloha",
"_id": "5f30547f2242bf327e522f62",
"_score": 4.2923875,
"_source": {
"haloha_id": "5f2f33c2c6f0fc27e725ee8a",
"text": "seeing daughter happy! ",
"mood": 0
}
}
我猜这里有 3 个正在匹配的字母“ing”,即在我的文档中,单词正在 sleep ,而在这个文档中,单词正在看到基于某些字母匹配的匹配这是我不想要的,因为这两个单词差别太大.
最佳答案
Fuzziness
被解释为 Levenshtein 编辑距离 — 需要对一个字符串进行的一个字符更改的数量,以使其与另一个字符串相同。
所以“ sleep ”将与“看到”匹配,因为它们只有一个字符的差异
不支持高于 2 编辑距离的模糊性。因此,模糊性的值只能是 1 和 2,因此允许百分比是没有意义的。
检查此评论 issue
In all cases the behaviour of fuzziness can be reduced to twointegers (as fuzziness above 2 isn't supported anyway): the thresholdat which it becomes 1, and at which it becomes 2. Percentage fuzzinessused to be supported but was removed, presumably because it suggestedthat there was more flexibility when really it was just being turnedinto two thresholds.
Are you suggesting that it should be customisable at the query level,rather than in configuration? If so, some thought would probably needto be put into the syntax, as there could be confusion betweensettings that define the fuzziness and those that define the lengththresholds for fuzziness, which are both integers.
关于elasticsearch - 在 ElasticSearch 中以百分比调整模糊级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63336654/
我在这里有一个问题,我不知道这是否正常。 但是我认为这里有些湖,安装插件elasticsearch-head之后,我在浏览器中启动url“http://localhost:9200/_plugin/h
我写了这个 flex 搜索查询: es.search(index=['ind1'],doc_type=['doc']) 我得到以下结果: {'_shards': {'failed': 0, 'skip
在ElasticSearch.Net v.5中,存在一个属性 Elasticsearch.Net.RequestData.Path ,该属性在ElasticSearch.Net v.6中已成为depr
如何让 elasticsearch 应用新配置?我更改了文件 ~ES_HOME/config/elasticsearch.yml 中的一个字符串: # Disable HTTP completely:
我正在尝试使用以下分析器在 elastic serach 7.1 中实现部分子字符串搜索 PUT my_index-001 { "settings": { "analysis": {
假设一个 elasticsearch 服务器在很短的时间内接收到 100 个任务。有些任务很短,有些任务很耗时,有些任务是删除任务,有些是插入和搜索查询。 elasticsearch 是如何决定先运行
我需要根据日期过滤一组值(在此处添加字段),然后按 device_id 对其进行分组。所以我正在使用以下东西: { "aggs":{ "dates_between":{ "fi
我在 Elasticsearch 中有一个企业索引。索引中的每个文档代表一个业务,每个业务都有business_hours。我试图允许使用星期几和时间过滤营业时间。例如,我们希望能够进行过滤,以显示我
我有一个这样的过滤查询 query: { filtered: { query: { bool: { should: [{multi_match: {
Elasticsearch 相当新,所以可能不得不忍受我,我遇到了一个问题,如果我使用 20 个字符或更少的字符搜索文档,文档会出现,但是查询中同一个单词中的任何更多字符,我没有结果: 使用“苯氧甲基
我试图更好地理解 ElasticSearch 的内部结构,所以我想知道 ElasticSearch 在内部计算以下两种情况的术语统计信息的方式是否存在任何差异。 第一种情况是当我有这样的文件时: {
在我的 elasticsearch 索引中,我索引了一堆工作。为简单起见,我们只说它们是一堆职位。当人们在我的搜索引擎中输入职位时,我想“自动完成”可能的匹配。 我在这里调查了完成建议:http://
我在很多映射中使用多字段。在 Elastic Search 的文档中,指示应将多字段替换为“fields”参数。参见 http://www.elasticsearch.org/guide/en/ela
我有如下查询, query = { "query": {"query_string": {"query": "%s" % q}}, "filter":{"ids
我有一个Json数据 "hits": [ { "_index": "outboxprov1", "_type": "deleted-c
这可能是一个初学者的问题,但我对大小有一些疑问。 根据 Elasticsearch 规范,大小的最大值可以是 10000,我想在下面验证我的理解: 示例查询: GET testindex-2016.0
我在 Elastic Search 中发现了滚动功能,这看起来非常有趣。看了那么多文档,下面的问题我还是不清楚。 如果偏移量已经存在那么为什么要使用滚动? 即将到来的记录呢?假设它完成了所有数据的滚动
我有以下基于注释的 Elasticsearch 配置,我已将索引设置为不被分析,因为我不希望这些字段被标记化: @Document(indexName = "abc", type = "efg
我正在尝试在单个索引中创建多个类型。例如,我试图在host索引中创建两种类型(post,ytb),以便在它们之间创建父子关系。 PUT /ytb { "mappings": { "po
我尝试创建一个简单的模板,包括一些动态模板,但我似乎无法为文档编制索引。 我得到错误: 400 {"error":"MapperParsingException[mapping [_default_]
我是一名优秀的程序员,十分优秀!