質問編集履歴
1
試したことを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -27,7 +27,35 @@
|
|
27
27
|
ご教授いただけませんでしょうか。
|
28
28
|
|
29
29
|
■一旦試したこと(第一ソート)
|
30
|
+
× :
|
31
|
+
```cakephp
|
32
|
+
'sort' => [
|
33
|
+
'_script' => [
|
34
|
+
'type' => 'number',
|
35
|
+
'script' => [
|
36
|
+
'lang' => 'painless',
|
37
|
+
'source' => '
|
38
|
+
int priority = 0;
|
39
|
+
|
30
|
-
|
40
|
+
if (doc["eki_name"].value =~ /params.search_input/) {
|
41
|
+
priority += 2;
|
42
|
+
}
|
43
|
+
|
44
|
+
if (doc["syz_name"].value =~ /params.search_input/) {
|
45
|
+
priority += 2;
|
46
|
+
}
|
47
|
+
|
48
|
+
return priority;
|
49
|
+
',
|
50
|
+
'params' => [
|
51
|
+
'search_input' => $search_input
|
52
|
+
]
|
53
|
+
],
|
54
|
+
'order' => 'desc'
|
55
|
+
],
|
56
|
+
'_score'
|
57
|
+
],
|
58
|
+
```
|
31
59
|
※現在、実装方法を調べている途中です。
|
32
60
|
|
33
61
|
|