gpt4 book ai didi

elasticsearch - 我想将elasticsearch中的高亮字段更改为snippet(S)。我正在使用sense(kibana)显示结果

转载 作者:行者123 更新时间:2023-12-03 00:15:33 25 4
gpt4 key购买 nike

这是我的查询:

GET index6april/_search
{
"fields": ["T","U", "UD", "UE"],
"query":{
"match_phrase": {
"newContent": "white"
}
},
"highlight" : {
"fields" : {
"newContent" : {"fragment_size" : 150, "number_of_fragments" : 3}
}
}
}

该查询的输出为:
{
"took": 24,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 7,
"max_score": 0.08275573,
"hits": [
{
"_index": "index6april",
"_type": "SearchTech",
"_id": "http://www.searchtechnologies.com/",
"_score": 0.08275573,
"fields": {
"U": [
"http://www.searchtechnologies.com/"
],
"T": [
"Enterprise Search and Big Data Experts"
],
"UD": [
"http://www.searchtechnologies.com/"
],
"UE": [
"http://www.searchtechnologies.com/"
]
},
"highlight": {
"newContent": [
"-Commerce Media & Publishing Government Fraud Detection Recruiting Log Analytics Customers Representative Customers Case Studies Resources Blog <em>White</em> Papers",
" Careers Federal Contract Vehicles Customer Support Contact Us Customer Success Story Adecco Recruits with Search & Big Data Featured <em>White</em> Paper Smart",
" Evaluation Enterprise Search <em>White</em> Papers Search Quality Analysis Search & Big Data Managed Services Microsoft Search Services SharePoint 2013 Search Services"
]
}
},
{
"_index": "index6april",
"_type": "SearchTech",
"_id": "http://www.searchtechnologies.com/support",
"_score": 0.08108373,
"fields": {
"U": [
"http://www.searchtechnologies.com/support"
],
"T": [
"Search Technologies"
],
"UD": [
"http://www.searchtechnologies.com/support"
],
"UE": [
"http://www.searchtechnologies.com/support"
]
},
"highlight": {
"newContent": [
"-Commerce Media & Publishing Government Fraud Detection Recruiting Log Analytics Customers Representative Customers Case Studies Resources Blog <em>White</em> Papers",
" Search Engines Is A Lot of Hard Work Other Resources Enterprise Search Case Studies Statistical Relevancy Evaluation Enterprise Search <em>White</em> Papers"
]
}
},
{
"_index": "index6april",
"_type": "SearchTech",
"_id": "http://www.searchtechnologies.com/Account/Login/",
"_score": 0.07644647,
"fields": {
"U": [
"http://www.searchtechnologies.com/Account/Login/"
],
"T": [
"Log in"
],
"UD": [
"http://www.searchtechnologies.com/Account/Login/"
],
"UE": [
"http://www.searchtechnologies.com/Account/Login/"
]
},
"highlight": {
"newContent": [
"-Commerce Media & Publishing Government Fraud Detection Recruiting Log Analytics Customers Representative Customers Case Studies Resources Blog <em>White</em> Papers"
]
}
},
{
"_index": "index6april",
"_type": "SearchTech",
"_id": "http://www.searchtechnologies.com/terms",
"_score": 0.04729884,
"fields": {
"U": [
"http://www.searchtechnologies.com/terms"
],
"T": [
"Terms of Use"
],
"UD": [
"http://www.searchtechnologies.com/terms"
],
"UE": [
"http://www.searchtechnologies.com/terms"
]
},
"highlight": {
"newContent": [
"-Commerce Media & Publishing Government Fraud Detection Recruiting Log Analytics Customers Representative Customers Case Studies Resources Blog <em>White</em> Papers",
" Relevancy Evaluation Enterprise Search <em>White</em> Papers Search Quality Analysis Search & Big Data Managed Services Microsoft Search Services SharePoint 2013"
]
}
},
{
"_index": "index6april",
"_type": "SearchTech",
"_id": "http://www.searchtechnologies.com/bundles/modernizr?v=7-yR01kdRVQ7W1RQzMBVKYLDhCt0itEATWHixfzE8Os1",
"_score": 0.038223237,
"fields": {
"UE": [
"http://www.searchtechnologies.com/bundles/modernizr?v=7-yR01kdRVQ7W1RQzMBVKYLDhCt0itEATWHixfzE8Os1"
],
"U": [
"http://www.searchtechnologies.com/bundles/modernizr?v=7-yR01kdRVQ7W1RQzMBVKYLDhCt0itEATWHixfzE8Os1"
],
"UD": [
"http://www.searchtechnologies.com/bundles/modernizr?v=7-yR01kdRVQ7W1RQzMBVKYLDhCt0itEATWHixfzE8Os1"
]
},
"highlight": {
"newContent": [
"=function(){var n=\"background-image:\",t=\"gradient(linear,left top,right bottom,from(#9f9),to(<em>white</em>));\",i=\"linear-gradient(left top,#9f9, <em>white</em>);\";return",
",from(#9f9),to(<em>white</em>));\",i=\"linear-gradient(left top,#9f9, <em>white</em>);\";return a((n+\"-webkit- \".split(\" \").join(t+n)+y.join(i+n)).slice(0,-n.length)),v"
]
}
},
{
"_index": "index6april",
"_type": "SearchTech",
"_id": "http://www.searchtechnologies.com/Content/css/customcss?v=ByvyFKgvAaWSEqvyecWIUDY7OhTiu-K7fyOIXe3rZpI1",
"_score": 0.027027909,
"fields": {
"UE": [
"http://www.searchtechnologies.com/Content/css/customcss?v=ByvyFKgvAaWSEqvyecWIUDY7OhTiu-K7fyOIXe3rZpI1"
],
"U": [
"http://www.searchtechnologies.com/Content/css/customcss?v=ByvyFKgvAaWSEqvyecWIUDY7OhTiu-K7fyOIXe3rZpI1"
],
"UD": [
"http://www.searchtechnologies.com/Content/css/customcss?v=ByvyFKgvAaWSEqvyecWIUDY7OhTiu-K7fyOIXe3rZpI1"
]
},
"highlight": {
"newContent": [
":12px}.navbar-inverse .navbar-nav>li>a{color:#dadada}.dropdown-menu>li>a:hover{background-color:#eee}.btn{<em>white</em>-space:normal}.homepage_box_small div{min",
" solid #ccc;border-radius:5px;line-height:.8em;padding:2px 8px 2px 8px!important;text-decoration:none;<em>white</em>-space:nowrap;display:inline-block}.category"
]
}
},
{
"_index": "index6april",
"_type": "SearchTech",
"_id": "http://www.searchtechnologies.com/bundles/js?v=SR_15IYr6MhqwbGxnaF13IhSSVER392Fy422ucY4GvM1",
"_score": 0.016722666,
"fields": {
"UE": [
"http://www.searchtechnologies.com/bundles/js?v=SR_15IYr6MhqwbGxnaF13IhSSVER392Fy422ucY4GvM1"
],
"U": [
"http://www.searchtechnologies.com/bundles/js?v=SR_15IYr6MhqwbGxnaF13IhSSVER392Fy422ucY4GvM1"
],
"UD": [
"http://www.searchtechnologies.com/bundles/js?v=SR_15IYr6MhqwbGxnaF13IhSSVER392Fy422ucY4GvM1"
]
},
"highlight": {
"newContent": [
"\").html(\"The <em>white</em> paper download link has been emailed to you at \"+r+\". <br />Please check your junk mail if you have a strong email filter"
]
}
}
]
}
}

如您所见,我在输出中得到一个突出显示字段,该字段突出显示了newcontent中的少量内容。我想在代码片段中显示高亮区域。我希望我的输出看起来像这样:
{
"took": 24,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"failed": 0
},
"hits": {
"total": 7,
"max_score": 0.08275573,
"hits": [
{
"_index": "index6april",
"_type": "SearchTech",
"_id": "http://www.searchtechnologies.com/",
"_score": 0.08275573,
"fields": {
"U": [
"http://www.searchtechnologies.com/"
],
"T": [
"Enterprise Search and Big Data Experts"
],
"UD": [
"http://www.searchtechnologies.com/"
],
"UE": [
"http://www.searchtechnologies.com/"
]
},
"S": {
"newContent": [
"-Commerce Media & Publishing Government Fraud Detection Recruiting Log Analytics Customers Representative Customers Case Studies Resources Blog <em>White</em> Papers",
" Careers Federal Contract Vehicles Customer Support Contact Us Customer Success Story Adecco Recruits with Search & Big Data Featured <em>White</em> Paper Smart",
" Evaluation Enterprise Search <em>White</em> Papers Search Quality Analysis Search & Big Data Managed Services Microsoft Search Services SharePoint 2013 Search Services"
]
}
},
...................

最佳答案

我认为目前(Elasticsearch 2.3)没有这样的选择。

关于elasticsearch - 我想将elasticsearch中的高亮字段更改为snippet(S)。我正在使用sense(kibana)显示结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36463779/

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