如何使用groovy脚本打印或记录某些变量进行评分?我知道有日志目录,但它们不记录我在脚本中打印的内容.
我正在努力找出为什么这个简单的例子不起作用.我将正则表达式简化为简单的例子,因为它们根本不起作用.
{
"settings" : {
"number_of_shards": 1,
"number_of_replicas": 0,
"index": {
"analysis": {
"char_filter" : {
"my_pattern" :{
"type": "pattern_replace",
"pattern": "a",
"replacement": "u"
}
},
"analyser": {
"my_analyser": {
"type": "custom",
"tokenizer": "whitespace",
"char_filter": ["my_pattern"]
}
}
}
}
},
"mappings" : {
"my_type" : {
"_source": {
"enabled": true
}
}
},
"properties": {
"test": {
"type": "string",
"store": true,
"index": "analysed",
"analyser": "my_analyser",
"index_options": "positions"
}
}
}'
Run Code Online (Sandbox Code Playgroud)
谢谢您的帮助
我索引了一个词:"挂"
$ curl -XGET 'http://localhost:9200/tm_de_fr/my_type/_search?q=hang&pretty=true'
{
"took" : …Run Code Online (Sandbox Code Playgroud) 如何使用PHP API来使用此功能.我没有找到方法.
curl -XGET 'localhost:9200/_analyze?analyzer=standard' -d 'this is a test'
Run Code Online (Sandbox Code Playgroud)
我需要访问它,因为我需要访问通过script_score计算我的分数的查询字符串.当然,不分析查询字符串.所以我必须分开做.
我知道这不是一个好的解决方案,但直到现在我才找到一个替代品.