Skip to content

Commit

Permalink
query -> queryDSL in Guillotine queries #5
Browse files Browse the repository at this point in the history
  • Loading branch information
anatol-sialitski committed Jan 12, 2024
1 parent 069ae03 commit 76fd59f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Below are some example queries you can use for fetching the sample content.

=== Get Persons

.Get the display name of five items from `persons/` folder:
.Get the display name and _path of free items from `/persons` folder:
[source,GraphQL]
----
{
Expand Down Expand Up @@ -264,7 +264,14 @@ IMPORTANT: If you used something other than `myproject` as a name for your app,
----
{
guillotine {
query(query: "type='myproject:movie'", first: 1) {
queryDsl(query: {
term: {
field: "type",
value: {
string: "myproject:movie"
}
}
}, first: 1) {
displayName
... on myproject_Movie {
data {
Expand All @@ -287,7 +294,7 @@ IMPORTANT: If you used something other than `myproject` as a name for your app,
{
"data": {
"guillotine": {
"query": [
"queryDsl": [
{
"displayName": "The Matrix",
"data": {
Expand Down Expand Up @@ -326,15 +333,33 @@ IMPORTANT: If you used something other than `myproject` as a name for your app,
----
{
guillotine {
query(query: "ngram('_allText', 'morgan') AND type='myproject:person'", first: 6) {
queryDsl(query: {
boolean: {
must: [
{
ngram: {
fields: ["_allText"],
query: "morgan"
}
},
{
term: {
field: "type",
value: {
string: "myproject:person"
}
}
}
]
}
}, first: 1) {
... on myproject_Person {
displayName
data {
photos(first:1){
... on media_Image {
imageUrl(type:absolute scale:"block(400,400)")
}
}
}
}
Expand All @@ -349,7 +374,7 @@ IMPORTANT: If you used something other than `myproject` as a name for your app,
{
"data": {
"guillotine": {
"query": [
"queryDsl": [
{
"displayName": "Morgan Freeman",
"data": {
Expand Down
Binary file modified docs/media/morgan-photo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 76fd59f

Please sign in to comment.