elasticsearch_query_parser 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +27 -0
- data/README.md +196 -0
- data/lib/doc/ElasticsearchQueryParser/Grammar/Parser.html +108 -0
- data/lib/doc/ElasticsearchQueryParser/Grammar/Presenters/Operator/InvalidOperatorString.html +206 -0
- data/lib/doc/ElasticsearchQueryParser/Grammar/Presenters/Operator.html +209 -0
- data/lib/doc/ElasticsearchQueryParser/Grammar/Presenters/Query.html +208 -0
- data/lib/doc/ElasticsearchQueryParser/Grammar/Presenters/Term.html +203 -0
- data/lib/doc/ElasticsearchQueryParser/Grammar/Presenters.html +99 -0
- data/lib/doc/ElasticsearchQueryParser/Grammar/Transformer.html +108 -0
- data/lib/doc/ElasticsearchQueryParser/Grammar.html +99 -0
- data/lib/doc/ElasticsearchQueryParser/ParseFailedException.html +163 -0
- data/lib/doc/ElasticsearchQueryParser/Sentence.html +219 -0
- data/lib/doc/ElasticsearchQueryParser.html +238 -0
- data/lib/doc/created.rid +8 -0
- data/lib/doc/css/fonts.css +167 -0
- data/lib/doc/css/rdoc.css +619 -0
- data/lib/doc/fonts/Lato-Light.ttf +0 -0
- data/lib/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/lib/doc/fonts/Lato-Regular.ttf +0 -0
- data/lib/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/lib/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/lib/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/lib/doc/images/add.png +0 -0
- data/lib/doc/images/arrow_up.png +0 -0
- data/lib/doc/images/brick.png +0 -0
- data/lib/doc/images/brick_link.png +0 -0
- data/lib/doc/images/bug.png +0 -0
- data/lib/doc/images/bullet_black.png +0 -0
- data/lib/doc/images/bullet_toggle_minus.png +0 -0
- data/lib/doc/images/bullet_toggle_plus.png +0 -0
- data/lib/doc/images/date.png +0 -0
- data/lib/doc/images/delete.png +0 -0
- data/lib/doc/images/find.png +0 -0
- data/lib/doc/images/loadingAnimation.gif +0 -0
- data/lib/doc/images/macFFBgHack.png +0 -0
- data/lib/doc/images/package.png +0 -0
- data/lib/doc/images/page_green.png +0 -0
- data/lib/doc/images/page_white_text.png +0 -0
- data/lib/doc/images/page_white_width.png +0 -0
- data/lib/doc/images/plugin.png +0 -0
- data/lib/doc/images/ruby.png +0 -0
- data/lib/doc/images/tag_blue.png +0 -0
- data/lib/doc/images/tag_green.png +0 -0
- data/lib/doc/images/transparent.png +0 -0
- data/lib/doc/images/wrench.png +0 -0
- data/lib/doc/images/wrench_orange.png +0 -0
- data/lib/doc/images/zoom.png +0 -0
- data/lib/doc/index.html +107 -0
- data/lib/doc/js/darkfish.js +84 -0
- data/lib/doc/js/navigation.js +105 -0
- data/lib/doc/js/navigation.js.gz +0 -0
- data/lib/doc/js/search.js +110 -0
- data/lib/doc/js/search_index.js +1 -0
- data/lib/doc/js/search_index.js.gz +0 -0
- data/lib/doc/js/searcher.js +229 -0
- data/lib/doc/js/searcher.js.gz +0 -0
- data/lib/doc/table_of_contents.html +175 -0
- data/lib/elasticsearch_query_parser/grammar/parser.rb +29 -0
- data/lib/elasticsearch_query_parser/grammar/presenters/operator.rb +41 -0
- data/lib/elasticsearch_query_parser/grammar/presenters/query.rb +45 -0
- data/lib/elasticsearch_query_parser/grammar/presenters/term.rb +21 -0
- data/lib/elasticsearch_query_parser/grammar/transformer.rb +37 -0
- data/lib/elasticsearch_query_parser/sentence.rb +55 -0
- data/lib/elasticsearch_query_parser.rb +52 -0
- metadata +135 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class ElasticsearchQueryParser::Grammar::Presenters::Operator - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../../../";
|
|
11
|
+
var index_rel_prefix = "../../../";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="../../../js/navigation.js" defer></script>
|
|
15
|
+
<script src="../../../js/search.js" defer></script>
|
|
16
|
+
<script src="../../../js/search_index.js" defer></script>
|
|
17
|
+
<script src="../../../js/searcher.js" defer></script>
|
|
18
|
+
<script src="../../../js/darkfish.js" defer></script>
|
|
19
|
+
|
|
20
|
+
<link href="../../../css/fonts.css" rel="stylesheet">
|
|
21
|
+
<link href="../../../css/rdoc.css" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<body id="top" role="document" class="class">
|
|
27
|
+
<nav role="navigation">
|
|
28
|
+
<div id="project-navigation">
|
|
29
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
30
|
+
<h2>
|
|
31
|
+
<a href="../../../index.html" rel="home">Home</a>
|
|
32
|
+
</h2>
|
|
33
|
+
|
|
34
|
+
<div id="table-of-contents-navigation">
|
|
35
|
+
<a href="../../../table_of_contents.html#pages">Pages</a>
|
|
36
|
+
<a href="../../../table_of_contents.html#classes">Classes</a>
|
|
37
|
+
<a href="../../../table_of_contents.html#methods">Methods</a>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
42
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
43
|
+
<div id="search-field-wrapper">
|
|
44
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
45
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
46
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
47
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<ul id="search-results" aria-label="Search Results"
|
|
51
|
+
aria-busy="false" aria-expanded="false"
|
|
52
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
53
|
+
</form>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<div id="class-metadata">
|
|
61
|
+
|
|
62
|
+
<div id="parent-class-section" class="nav-section">
|
|
63
|
+
<h3>Parent</h3>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
<p class="link">Object
|
|
67
|
+
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<!-- Method Quickref -->
|
|
73
|
+
<div id="method-list-section" class="nav-section">
|
|
74
|
+
<h3>Methods</h3>
|
|
75
|
+
|
|
76
|
+
<ul class="link-list" role="directory">
|
|
77
|
+
|
|
78
|
+
<li ><a href="#method-c-new">::new</a>
|
|
79
|
+
|
|
80
|
+
<li ><a href="#method-i-to_elasticsearch">#to_elasticsearch</a>
|
|
81
|
+
|
|
82
|
+
</ul>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
</nav>
|
|
87
|
+
|
|
88
|
+
<main role="main" aria-labelledby="class-ElasticsearchQueryParser::Grammar::Presenters::Operator">
|
|
89
|
+
<h1 id="class-ElasticsearchQueryParser::Grammar::Presenters::Operator" class="class">
|
|
90
|
+
class ElasticsearchQueryParser::Grammar::Presenters::Operator
|
|
91
|
+
</h1>
|
|
92
|
+
|
|
93
|
+
<section class="description">
|
|
94
|
+
|
|
95
|
+
</section>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
109
|
+
<header>
|
|
110
|
+
<h3>Public Class Methods</h3>
|
|
111
|
+
</header>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<div id="method-c-new" class="method-detail ">
|
|
115
|
+
|
|
116
|
+
<div class="method-heading">
|
|
117
|
+
<span class="method-name">new</span><span
|
|
118
|
+
class="method-args">(operator)</span>
|
|
119
|
+
|
|
120
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
121
|
+
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
<div class="method-description">
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<div class="method-source-code" id="new-source">
|
|
133
|
+
<pre><span class="ruby-comment"># File elasticsearch_query_parser/grammar/presenters/operator.rb, line 22</span>
|
|
134
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">operator</span>)
|
|
135
|
+
<span class="ruby-ivar">@operator</span> = (<span class="ruby-identifier">operator</span> <span class="ruby-operator">||</span> <span class="ruby-string">"OR"</span>).<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">downcase</span>
|
|
136
|
+
<span class="ruby-keyword">end</span></pre>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
</section>
|
|
148
|
+
|
|
149
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
150
|
+
<header>
|
|
151
|
+
<h3>Public Instance Methods</h3>
|
|
152
|
+
</header>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
<div id="method-i-to_elasticsearch" class="method-detail ">
|
|
156
|
+
|
|
157
|
+
<div class="method-heading">
|
|
158
|
+
<span class="method-name">to_elasticsearch</span><span
|
|
159
|
+
class="method-args">()</span>
|
|
160
|
+
|
|
161
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
162
|
+
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<div class="method-description">
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<div class="method-source-code" id="to_elasticsearch-source">
|
|
174
|
+
<pre><span class="ruby-comment"># File elasticsearch_query_parser/grammar/presenters/operator.rb, line 26</span>
|
|
175
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_elasticsearch</span>
|
|
176
|
+
<span class="ruby-keyword">case</span> <span class="ruby-identifier">operator</span>
|
|
177
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">"and"</span>
|
|
178
|
+
<span class="ruby-value">:must</span>
|
|
179
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">"not"</span>
|
|
180
|
+
<span class="ruby-value">:must_not</span>
|
|
181
|
+
<span class="ruby-keyword">when</span> <span class="ruby-string">"or"</span>
|
|
182
|
+
<span class="ruby-value">:should</span>
|
|
183
|
+
<span class="ruby-keyword">else</span>
|
|
184
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOperatorString</span>, <span class="ruby-identifier">operator</span>
|
|
185
|
+
<span class="ruby-keyword">end</span>
|
|
186
|
+
<span class="ruby-keyword">end</span></pre>
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
</div>
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
</section>
|
|
198
|
+
|
|
199
|
+
</section>
|
|
200
|
+
|
|
201
|
+
</main>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
<footer id="validator-badges" role="contentinfo">
|
|
205
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
206
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
|
|
207
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
208
|
+
</footer>
|
|
209
|
+
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class ElasticsearchQueryParser::Grammar::Presenters::Query - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../../../";
|
|
11
|
+
var index_rel_prefix = "../../../";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="../../../js/navigation.js" defer></script>
|
|
15
|
+
<script src="../../../js/search.js" defer></script>
|
|
16
|
+
<script src="../../../js/search_index.js" defer></script>
|
|
17
|
+
<script src="../../../js/searcher.js" defer></script>
|
|
18
|
+
<script src="../../../js/darkfish.js" defer></script>
|
|
19
|
+
|
|
20
|
+
<link href="../../../css/fonts.css" rel="stylesheet">
|
|
21
|
+
<link href="../../../css/rdoc.css" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<body id="top" role="document" class="class">
|
|
27
|
+
<nav role="navigation">
|
|
28
|
+
<div id="project-navigation">
|
|
29
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
30
|
+
<h2>
|
|
31
|
+
<a href="../../../index.html" rel="home">Home</a>
|
|
32
|
+
</h2>
|
|
33
|
+
|
|
34
|
+
<div id="table-of-contents-navigation">
|
|
35
|
+
<a href="../../../table_of_contents.html#pages">Pages</a>
|
|
36
|
+
<a href="../../../table_of_contents.html#classes">Classes</a>
|
|
37
|
+
<a href="../../../table_of_contents.html#methods">Methods</a>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
42
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
43
|
+
<div id="search-field-wrapper">
|
|
44
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
45
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
46
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
47
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<ul id="search-results" aria-label="Search Results"
|
|
51
|
+
aria-busy="false" aria-expanded="false"
|
|
52
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
53
|
+
</form>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<div id="class-metadata">
|
|
61
|
+
|
|
62
|
+
<div id="parent-class-section" class="nav-section">
|
|
63
|
+
<h3>Parent</h3>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
<p class="link">Object
|
|
67
|
+
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<!-- Method Quickref -->
|
|
73
|
+
<div id="method-list-section" class="nav-section">
|
|
74
|
+
<h3>Methods</h3>
|
|
75
|
+
|
|
76
|
+
<ul class="link-list" role="directory">
|
|
77
|
+
|
|
78
|
+
<li ><a href="#method-c-new">::new</a>
|
|
79
|
+
|
|
80
|
+
<li ><a href="#method-i-to_elasticsearch">#to_elasticsearch</a>
|
|
81
|
+
|
|
82
|
+
</ul>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
</nav>
|
|
87
|
+
|
|
88
|
+
<main role="main" aria-labelledby="class-ElasticsearchQueryParser::Grammar::Presenters::Query">
|
|
89
|
+
<h1 id="class-ElasticsearchQueryParser::Grammar::Presenters::Query" class="class">
|
|
90
|
+
class ElasticsearchQueryParser::Grammar::Presenters::Query
|
|
91
|
+
</h1>
|
|
92
|
+
|
|
93
|
+
<section class="description">
|
|
94
|
+
|
|
95
|
+
</section>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
109
|
+
<header>
|
|
110
|
+
<h3>Public Class Methods</h3>
|
|
111
|
+
</header>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<div id="method-c-new" class="method-detail ">
|
|
115
|
+
|
|
116
|
+
<div class="method-heading">
|
|
117
|
+
<span class="method-name">new</span><span
|
|
118
|
+
class="method-args">(terms, operator, nested_query)</span>
|
|
119
|
+
|
|
120
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
121
|
+
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
<div class="method-description">
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<div class="method-source-code" id="new-source">
|
|
133
|
+
<pre><span class="ruby-comment"># File elasticsearch_query_parser/grammar/presenters/query.rb, line 8</span>
|
|
134
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">terms</span>, <span class="ruby-identifier">operator</span>, <span class="ruby-identifier">nested_query</span>)
|
|
135
|
+
<span class="ruby-ivar">@terms</span> = <span class="ruby-identifier">terms</span>
|
|
136
|
+
<span class="ruby-ivar">@operator</span> = <span class="ruby-identifier">operator</span>
|
|
137
|
+
<span class="ruby-ivar">@nested_query</span> = <span class="ruby-identifier">nested_query</span>
|
|
138
|
+
<span class="ruby-keyword">end</span></pre>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
</div>
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
</section>
|
|
150
|
+
|
|
151
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
152
|
+
<header>
|
|
153
|
+
<h3>Public Instance Methods</h3>
|
|
154
|
+
</header>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
<div id="method-i-to_elasticsearch" class="method-detail ">
|
|
158
|
+
|
|
159
|
+
<div class="method-heading">
|
|
160
|
+
<span class="method-name">to_elasticsearch</span><span
|
|
161
|
+
class="method-args">(include_bool_header = true)</span>
|
|
162
|
+
|
|
163
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
164
|
+
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
<div class="method-description">
|
|
169
|
+
|
|
170
|
+
<p>If its `must_not` operator - just add `must_not` to root node and continue analyze nested queries Otherwise for nested query add new nested nodes</p>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
<div class="method-source-code" id="to_elasticsearch-source">
|
|
176
|
+
<pre><span class="ruby-comment"># File elasticsearch_query_parser/grammar/presenters/query.rb, line 16</span>
|
|
177
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_elasticsearch</span>(<span class="ruby-identifier">include_bool_header</span> = <span class="ruby-keyword">true</span>)
|
|
178
|
+
<span class="ruby-identifier">query</span> = <span class="ruby-keyword">if</span> <span class="ruby-identifier">operator</span>.<span class="ruby-identifier">to_elasticsearch</span> <span class="ruby-operator">==</span> <span class="ruby-value">:must_not</span>
|
|
179
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">nested_query</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_elasticsearch</span>(<span class="ruby-keyword">false</span>)
|
|
180
|
+
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-value">must_not:</span> <span class="ruby-identifier">result</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:must_not</span>, []) <span class="ruby-operator">+</span> <span class="ruby-identifier">match_query</span>(<span class="ruby-identifier">terms</span>))
|
|
181
|
+
<span class="ruby-keyword">else</span>
|
|
182
|
+
{ <span class="ruby-identifier">operator</span>.<span class="ruby-identifier">to_elasticsearch</span> <span class="ruby-operator">=></span> <span class="ruby-identifier">match_query</span>(<span class="ruby-identifier">terms</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">nested_query</span>) }
|
|
183
|
+
<span class="ruby-keyword">end</span>
|
|
184
|
+
<span class="ruby-identifier">include_bool_header</span> <span class="ruby-operator">?</span> { <span class="ruby-value">bool:</span> <span class="ruby-identifier">query</span> } <span class="ruby-operator">:</span> <span class="ruby-identifier">query</span>
|
|
185
|
+
<span class="ruby-keyword">end</span></pre>
|
|
186
|
+
</div>
|
|
187
|
+
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
</section>
|
|
197
|
+
|
|
198
|
+
</section>
|
|
199
|
+
|
|
200
|
+
</main>
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
<footer id="validator-badges" role="contentinfo">
|
|
204
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
205
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
|
|
206
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
207
|
+
</footer>
|
|
208
|
+
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
|
|
3
|
+
<html>
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
|
|
7
|
+
<title>class ElasticsearchQueryParser::Grammar::Presenters::Term - RDoc Documentation</title>
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript">
|
|
10
|
+
var rdoc_rel_prefix = "../../../";
|
|
11
|
+
var index_rel_prefix = "../../../";
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script src="../../../js/navigation.js" defer></script>
|
|
15
|
+
<script src="../../../js/search.js" defer></script>
|
|
16
|
+
<script src="../../../js/search_index.js" defer></script>
|
|
17
|
+
<script src="../../../js/searcher.js" defer></script>
|
|
18
|
+
<script src="../../../js/darkfish.js" defer></script>
|
|
19
|
+
|
|
20
|
+
<link href="../../../css/fonts.css" rel="stylesheet">
|
|
21
|
+
<link href="../../../css/rdoc.css" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<body id="top" role="document" class="class">
|
|
27
|
+
<nav role="navigation">
|
|
28
|
+
<div id="project-navigation">
|
|
29
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
30
|
+
<h2>
|
|
31
|
+
<a href="../../../index.html" rel="home">Home</a>
|
|
32
|
+
</h2>
|
|
33
|
+
|
|
34
|
+
<div id="table-of-contents-navigation">
|
|
35
|
+
<a href="../../../table_of_contents.html#pages">Pages</a>
|
|
36
|
+
<a href="../../../table_of_contents.html#classes">Classes</a>
|
|
37
|
+
<a href="../../../table_of_contents.html#methods">Methods</a>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
42
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
43
|
+
<div id="search-field-wrapper">
|
|
44
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
45
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
46
|
+
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
47
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<ul id="search-results" aria-label="Search Results"
|
|
51
|
+
aria-busy="false" aria-expanded="false"
|
|
52
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
|
53
|
+
</form>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<div id="class-metadata">
|
|
61
|
+
|
|
62
|
+
<div id="parent-class-section" class="nav-section">
|
|
63
|
+
<h3>Parent</h3>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
<p class="link">Object
|
|
67
|
+
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<!-- Method Quickref -->
|
|
73
|
+
<div id="method-list-section" class="nav-section">
|
|
74
|
+
<h3>Methods</h3>
|
|
75
|
+
|
|
76
|
+
<ul class="link-list" role="directory">
|
|
77
|
+
|
|
78
|
+
<li ><a href="#method-c-new">::new</a>
|
|
79
|
+
|
|
80
|
+
<li ><a href="#method-i-to_elasticsearch">#to_elasticsearch</a>
|
|
81
|
+
|
|
82
|
+
</ul>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
</nav>
|
|
87
|
+
|
|
88
|
+
<main role="main" aria-labelledby="class-ElasticsearchQueryParser::Grammar::Presenters::Term">
|
|
89
|
+
<h1 id="class-ElasticsearchQueryParser::Grammar::Presenters::Term" class="class">
|
|
90
|
+
class ElasticsearchQueryParser::Grammar::Presenters::Term
|
|
91
|
+
</h1>
|
|
92
|
+
|
|
93
|
+
<section class="description">
|
|
94
|
+
|
|
95
|
+
</section>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
|
109
|
+
<header>
|
|
110
|
+
<h3>Public Class Methods</h3>
|
|
111
|
+
</header>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<div id="method-c-new" class="method-detail ">
|
|
115
|
+
|
|
116
|
+
<div class="method-heading">
|
|
117
|
+
<span class="method-name">new</span><span
|
|
118
|
+
class="method-args">(term)</span>
|
|
119
|
+
|
|
120
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
121
|
+
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
<div class="method-description">
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<div class="method-source-code" id="new-source">
|
|
133
|
+
<pre><span class="ruby-comment"># File elasticsearch_query_parser/grammar/presenters/term.rb, line 8</span>
|
|
134
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">term</span>)
|
|
135
|
+
<span class="ruby-ivar">@term</span> = <span class="ruby-identifier">term</span>.<span class="ruby-identifier">to_s</span>
|
|
136
|
+
<span class="ruby-keyword">end</span></pre>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
</section>
|
|
148
|
+
|
|
149
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
|
150
|
+
<header>
|
|
151
|
+
<h3>Public Instance Methods</h3>
|
|
152
|
+
</header>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
<div id="method-i-to_elasticsearch" class="method-detail ">
|
|
156
|
+
|
|
157
|
+
<div class="method-heading">
|
|
158
|
+
<span class="method-name">to_elasticsearch</span><span
|
|
159
|
+
class="method-args">()</span>
|
|
160
|
+
|
|
161
|
+
<span class="method-click-advice">click to toggle source</span>
|
|
162
|
+
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<div class="method-description">
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<div class="method-source-code" id="to_elasticsearch-source">
|
|
174
|
+
<pre><span class="ruby-comment"># File elasticsearch_query_parser/grammar/presenters/term.rb, line 12</span>
|
|
175
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_elasticsearch</span>
|
|
176
|
+
{
|
|
177
|
+
<span class="ruby-value">query:</span> <span class="ruby-identifier">term</span>,
|
|
178
|
+
<span class="ruby-value">operator:</span> <span class="ruby-string">"and"</span>
|
|
179
|
+
}
|
|
180
|
+
<span class="ruby-keyword">end</span></pre>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
</div>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
</section>
|
|
192
|
+
|
|
193
|
+
</section>
|
|
194
|
+
|
|
195
|
+
</main>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
<footer id="validator-badges" role="contentinfo">
|
|
199
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
|
200
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.0.
|
|
201
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
202
|
+
</footer>
|
|
203
|
+
|