Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

This file was deleted.

4 changes: 3 additions & 1 deletion docs/java-api/query-dsl.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Note that you can easily print (aka debug) JSON generated queries using
The `QueryBuilder` can then be used with any API that accepts a query,
such as `count` and `search`.

:query-dsl-test: {docdir}/../../client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/QueryDSLDocumentationTests.java

include::query-dsl/match-all-query.asciidoc[]

include::query-dsl/full-text-queries.asciidoc[]
Expand All @@ -35,4 +37,4 @@ include::query-dsl/special-queries.asciidoc[]

include::query-dsl/span-queries.asciidoc[]


:query-dsl-test!:
10 changes: 2 additions & 8 deletions docs/java-api/query-dsl/bool-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@

See {ref}/query-dsl-bool-query.html[Bool Query]

[source,java]
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
QueryBuilder qb = boolQuery()
.must(termQuery("content", "test1")) <1>
.must(termQuery("content", "test4")) <1>
.mustNot(termQuery("content", "test2")) <2>
.should(termQuery("content", "test3")) <3>
.filter(termQuery("content", "test5")); <4>
include-tagged::{query-dsl-test}[bool]
--------------------------------------------------
<1> must query
<2> must not query
<3> should query
<4> a query that must appear in the matching documents but doesn't contribute to scoring.

8 changes: 2 additions & 6 deletions docs/java-api/query-dsl/boosting-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@

See {ref}/query-dsl-boosting-query.html[Boosting Query]

[source,java]
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
QueryBuilder qb = boostingQuery(
termQuery("name","kimchy"), <1>
termQuery("name","dadoonet")) <2>
.negativeBoost(0.2f); <3>
include-tagged::{query-dsl-test}[boosting]
--------------------------------------------------
<1> query that will promote documents
<2> query that will demote documents
<3> negative boost

Loading