File: ee0fd67acc807f1bddf5e9807c06e7eb.asciidoc

package info (click to toggle)
python-elasticsearch 9.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 22,728 kB
  • sloc: python: 104,053; makefile: 151; javascript: 75
file content (95 lines) | stat: -rw-r--r-- 3,277 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// This file is autogenerated, DO NOT EDIT
// query-dsl/weighted-tokens-query.asciidoc:86

[source, python]
----
resp = client.search(
    index="my-index",
    query={
        "weighted_tokens": {
            "query_expansion_field": {
                "tokens": {
                    "2161": 0.4679,
                    "2621": 0.307,
                    "2782": 0.1299,
                    "2851": 0.1056,
                    "3088": 0.3041,
                    "3376": 0.1038,
                    "3467": 0.4873,
                    "3684": 0.8958,
                    "4380": 0.334,
                    "4542": 0.4636,
                    "4633": 2.2805,
                    "4785": 1.2628,
                    "4860": 1.0655,
                    "5133": 1.0709,
                    "7139": 1.0016,
                    "7224": 0.2486,
                    "7387": 0.0985,
                    "7394": 0.0542,
                    "8915": 0.369,
                    "9156": 2.8947,
                    "10505": 0.2771,
                    "11464": 0.3996,
                    "13525": 0.0088,
                    "14178": 0.8161,
                    "16893": 0.1376,
                    "17851": 1.5348,
                    "19939": 0.6012
                },
                "pruning_config": {
                    "tokens_freq_ratio_threshold": 5,
                    "tokens_weight_threshold": 0.4,
                    "only_score_pruned_tokens": False
                }
            }
        }
    },
    rescore={
        "window_size": 100,
        "query": {
            "rescore_query": {
                "weighted_tokens": {
                    "query_expansion_field": {
                        "tokens": {
                            "2161": 0.4679,
                            "2621": 0.307,
                            "2782": 0.1299,
                            "2851": 0.1056,
                            "3088": 0.3041,
                            "3376": 0.1038,
                            "3467": 0.4873,
                            "3684": 0.8958,
                            "4380": 0.334,
                            "4542": 0.4636,
                            "4633": 2.2805,
                            "4785": 1.2628,
                            "4860": 1.0655,
                            "5133": 1.0709,
                            "7139": 1.0016,
                            "7224": 0.2486,
                            "7387": 0.0985,
                            "7394": 0.0542,
                            "8915": 0.369,
                            "9156": 2.8947,
                            "10505": 0.2771,
                            "11464": 0.3996,
                            "13525": 0.0088,
                            "14178": 0.8161,
                            "16893": 0.1376,
                            "17851": 1.5348,
                            "19939": 0.6012
                        },
                        "pruning_config": {
                            "tokens_freq_ratio_threshold": 5,
                            "tokens_weight_threshold": 0.4,
                            "only_score_pruned_tokens": True
                        }
                    }
                }
            }
        }
    },
)
print(resp)
----