@@ -32,7 +32,7 @@ image::hadouken-indentation.jpg[hadouken indenting]
3232
3333=== Operator Overloading
3434
35- For this reason, NEST introduces **operator overloading** so complex bool queries become easier to write.
35+ For this reason, NEST introduces **operator overloading** so complex bool queries become easier to write.
3636The previous example now becomes the following with the fluent API
3737
3838[source,csharp]
@@ -48,14 +48,14 @@ or, using the object initializer syntax
4848----
4949searchResults = this.Client.Search<Project>(new SearchRequest<Project>
5050{
51- Query = new TermQuery { Field = "name", Value= "x" }
51+ Query = new TermQuery { Field = "name", Value= "x" }
5252 || new TermQuery { Field = Field<Project>(p=>p.Name), Value = "y" }
5353});
5454----
5555
56- A naive implementation of operator overloading would rewrite
56+ A naive implementation of operator overloading would rewrite
5757
58- `term && term && term` to
58+ `term && term && term` to
5959
6060....
6161bool
6767 |___term
6868....
6969
70- As you can image this becomes unwieldy quite fast the more complex a query becomes NEST can spot these and
70+ As you can image this becomes unwieldy quite fast the more complex a query becomes NEST can spot these and
7171join them together to become a single bool query
7272
7373....
7474bool
75- |___must
75+ |___must
7676 |___term
7777 |___term
7878 |___term
@@ -119,7 +119,7 @@ When combining multiple queries some or all possibly marked as `must_not` or `fi
119119
120120....
121121bool
122- |___must
122+ |___must
123123| |___term
124124| |___term
125125| |___term
@@ -148,14 +148,14 @@ Even more involved `term && term && term && !term && +term && +term` still only
148148
149149....
150150bool
151- |___must
151+ |___must
152152| |___term
153153| |___term
154154| |___term
155155|
156156|___must_not
157157| |___term
158- |
158+ |
159159|___filter
160160 |___term
161161 |___term
@@ -180,7 +180,7 @@ c.Bool.MustNot.Should().HaveCount(1);
180180c.Bool.Filter.Should().HaveCount(2);
181181----
182182
183- You can still mix and match actual bool queries with the bool DSL e.g `bool(must=term, term, term) && !term` would still merge into a single `bool` query.
183+ You can still mix and match actual bool queries with the bool DSL e.g `bool(must=term, term, term) && !term` would still merge into a single `bool` query.
184184
185185[source,csharp]
186186----
@@ -225,15 +225,15 @@ lastClause.Bool.Should.Should().HaveCount(3);
225225
226226TIP: *add parentheses to force evaluation order*
227227
228- Also note that using shoulds as boosting factors can be really powerful so if you need this
228+ Also note that using shoulds as boosting factors can be really powerful so if you need this
229229always remember that you can mix and match an actual bool query with the bool dsl.
230230
231231There is another subtle situation where NEST will not blindly merge 2 bool queries with only should clauses. Imagine the following:
232232
233- `bool(should=term1, term2, term3, term4, minimum_should_match=2) || term5 || term6`
233+ `bool(should=term1, term2, term3, term4, minimum_should_match=2) || term5 || term6`
234234
235- if NEST identified both sides of the OR operation as only containing `should` clauses and it would
236- join them together it would give a different meaning to the `minimum_should_match` parameter of the first boolean query.
235+ if NEST identified both sides of the OR operation as only containing `should` clauses and it would
236+ join them together it would give a different meaning to the `minimum_should_match` parameter of the first boolean query.
237237Rewriting this to a single bool with 5 `should` clauses would break because only matching on `term5` or `term6` should still be a hit.
238238
239239[source,csharp]
@@ -265,8 +265,8 @@ nestedBool.Bool.Should.Should().HaveCount(4);
265265
266266=== Locked bool queries
267267
268- NEST will not combine `bool` queries if any of the query metadata is set e.g if metadata such as `boost` or `name` are set,
269- NEST will treat these as locked
268+ NEST will not combine `bool` queries if any of the query metadata is set e.g if metadata such as `boost` or `name` are set,
269+ NEST will treat these as locked
270270
271271Here we demonstrate that two locked `bool` queries are not combined
272272
@@ -317,7 +317,7 @@ nestedBool.Bool.Name.Should().Be(firstName);
317317
318318[source,csharp]
319319----
320- assert(fluent.InvokeQuery (new QueryContainerDescriptor<Project>()));
320+ assert(fluent.Invoke (new QueryContainerDescriptor<Project>()));
321321
322322assert((QueryContainer)ois);
323323----
0 commit comments