gpt4 book ai didi

elasticsearch - Elasticsearch突出显示 bool 值而不是搜索短语

转载 作者:行者123 更新时间:2023-12-03 02:01:21 25 4
gpt4 key购买 nike

我在 Elasticsearch 突出显示时遇到了问题。我正在使用elasticsearch-web plugin from Rivetlogic将Elasticsearch集成到Liferay门户中。效果很好,但是当我在某些文档上使用荧光笔时,突出显示的单词是错误的。这些问题似乎与Rivetlogic插件本身无关,我还可以通过带有普通Elasticsearch查询的Sense插件模拟它。

查询示例:

POST /liferay_company_20155/com_liferay_portlet_documentlibrary_model_DLFileEntry/_search
{
"query": {
"query_string": {
"query": "+(+(companyId:20155) +((+(entryClassName:com.liferay.portal.model.User) +(status:0)) (+(entryClassName:com.liferay.portlet.bookmarks.model.BookmarksEntry) +(status:0)) (+(entryClassName:com.liferay.portlet.bookmarks.model.BookmarksFolder) +(status:0)) (+(entryClassName:com.liferay.portlet.blogs.model.BlogsEntry) +(status:0)) (+(entryClassName:com.liferay.portlet.documentlibrary.model.DLFileEntry) +(status:0) +(hidden:false)) (+(entryClassName:com.liferay.portlet.documentlibrary.model.DLFolder) +(status:0) +(hidden:false)) (+(entryClassName:com.liferay.portlet.journal.model.JournalArticle) +(status:0) +(head:true)) (+(entryClassName:com.liferay.portlet.journal.model.JournalFolder) +(status:0)) (+(entryClassName:com.liferay.portlet.messageboards.model.MBMessage) +(status:0) +(discussion:false)) (+(entryClassName:com.liferay.portlet.wiki.model.WikiPage) +(status:0)))) +(assetCategoryTitles:*zkouska* assetCategoryTitles_cs_CZ:*zkouska* assetTagNames:*zkouska* comments:zkouska content:zkouska description:zkouska properties:zkouska title:zkouska url:zkouska userName:*zkouska* -stagingGroup:true city:zkouska country:zkouska emailAddress:*zkouska* firstName:zkouska fullName:zkouska lastName:zkouska middleName:zkouska region:zkouska screenName:zkouska street:zkouska zip:zkouska ddmContent:zkouska extension:zkouska fileEntryTypeId:zkouska path:*zkouska* classPK:zkouska content_cs_CZ:zkouska description_cs_CZ:zkouska entryClassPK:zkouska title_cs_CZ:zkouska type:zkouska articleId:zkouska)"
}
},
"highlight": {
"pre_tags" : ["<tag1>"],
"post_tags" : ["</tag1>"],
"fields": {
"content": {}
}
}
}

结果突出显示如下:
"highlight": 
{
"content": [
" logické\n1 nebo <tag1>0</tag1> (<tag1>true</tag1> nebo <tag1>false</tag1>).\n\nfunction ALTERNATIV(P:real): Boolean;\nvar X: real;\nbegin\n\nX",
" pouze na změnu <tag1>FALSE</tag1> na <tag1>TRUE</tag1>, případně na\npřekročení mezní hodnoty směrem nahoru). Protože C",
" (metoda Test), a to buď z hodnoty nula (<tag1>FALSE</tag1>) na\nhodnotu různou od nuly (<tag1>TRUE</tag1>), nebo obráceně",
"\n\ndetekci změny pouze z hodnoty <tag1>FALSE</tag1> na hodnotu <tag1>TRUE</tag1>, DetectDOWN detekuje opačnou\nzměnu. DetectALL",
" článek. Nechť X(ui) = x, Y (ui) = y, T =\n〈<tag1>0</tag1>,∞), I = O = R, I je vstupní abeceda, O je výstupní abeceda"
]
}

注意,所有值“FALSE”,“TRUE”和“0”都突出显示。所查询的单词“zkouska”也将突出显示。

查询有问题吗?

任何帮助都适用。

最佳答案

require_field_match设置为true应该可以解决此问题。

例:

POST /liferay_company_20155/com_liferay_portlet_documentlibrary_model_DLFileEntry/_search
{
"query": {
"query_string": {
"query": "+(+(companyId:20155) +((+(entryClassName:com.liferay.portal.model.User) +(status:0)) (+(entryClassName:com.liferay.portlet.bookmarks.model.BookmarksEntry) +(status:0)) (+(entryClassName:com.liferay.portlet.bookmarks.model.BookmarksFolder) +(status:0)) (+(entryClassName:com.liferay.portlet.blogs.model.BlogsEntry) +(status:0)) (+(entryClassName:com.liferay.portlet.documentlibrary.model.DLFileEntry) +(status:0) +(hidden:false)) (+(entryClassName:com.liferay.portlet.documentlibrary.model.DLFolder) +(status:0) +(hidden:false)) (+(entryClassName:com.liferay.portlet.journal.model.JournalArticle) +(status:0) +(head:true)) (+(entryClassName:com.liferay.portlet.journal.model.JournalFolder) +(status:0)) (+(entryClassName:com.liferay.portlet.messageboards.model.MBMessage) +(status:0) +(discussion:false)) (+(entryClassName:com.liferay.portlet.wiki.model.WikiPage) +(status:0)))) +(assetCategoryTitles:*zkouska* assetCategoryTitles_cs_CZ:*zkouska* assetTagNames:*zkouska* comments:zkouska content:zkouska description:zkouska properties:zkouska title:zkouska url:zkouska userName:*zkouska* -stagingGroup:true city:zkouska country:zkouska emailAddress:*zkouska* firstName:zkouska fullName:zkouska lastName:zkouska middleName:zkouska region:zkouska screenName:zkouska street:zkouska zip:zkouska ddmContent:zkouska extension:zkouska fileEntryTypeId:zkouska path:*zkouska* classPK:zkouska content_cs_CZ:zkouska description_cs_CZ:zkouska entryClassPK:zkouska title_cs_CZ:zkouska type:zkouska articleId:zkouska)"
}
},
"highlight": {
"require_field_match" : true,
"pre_tags" : ["<tag1>"],
"post_tags" : ["</tag1>"],
"fields": {
"content": {}
}
}
}

同样在不相关的注解中,它看起来像 status的映射, hidden字段似乎是 string,也许您希望它是 boolean

关于elasticsearch - Elasticsearch突出显示 bool 值而不是搜索短语,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32134531/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com