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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public BoolQueryBuilder addQueryForField(BoolQueryBuilder query, String field, O
}
break;
case MATCH:
query.must(QueryBuilders.matchQuery(field, value));
if (value instanceof List) {
query.must(QueryBuilders.matchQuery(field, ((List)value).get(0)));
} else {
query.must(QueryBuilders.matchQuery(field, value));
}
break;
default:
break;
Expand Down
59 changes: 45 additions & 14 deletions example/search.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"info": {
"_postman_id": "1ca92623-8c37-47d1-8d35-5684f4a0cdb8",
"_postman_id": "34257752-6305-4dae-b6d8-b71fa98b9963",
"name": "search",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "7302261"
},
"item": [
{
Expand All @@ -11,7 +12,6 @@
{
"listen": "test",
"script": {
"id": "217210a9-1489-4057-b89f-bc0b44111569",
"exec": [
"",
"pm.test(\"Status code is 200\", function () {",
Expand Down Expand Up @@ -67,7 +67,6 @@
{
"listen": "test",
"script": {
"id": "10fb6974-d6a5-4c9f-a4d8-1fc0c6739c33",
"exec": [
"pm.test(\"response has org s\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -109,7 +108,6 @@
{
"listen": "test",
"script": {
"id": "db56bdc2-e7bb-49af-9a7e-93359c7c1fd5",
"exec": [
"pm.test(\"response has project ss\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -151,7 +149,6 @@
{
"listen": "test",
"script": {
"id": "f23976f1-afb8-495f-892a-dcbcc7360665",
"exec": [
"pm.test(\"response has elements\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -199,7 +196,6 @@
{
"listen": "test",
"script": {
"id": "4ea3441a-8a0f-421a-ba27-67ac1351775d",
"exec": [
"pm.test(\"response has 1 element\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -241,7 +237,6 @@
{
"listen": "test",
"script": {
"id": "4ea3441a-8a0f-421a-ba27-67ac1351775d",
"exec": [
"pm.test(\"response has 2 elements\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -288,7 +283,6 @@
{
"listen": "test",
"script": {
"id": "c59583b1-35e6-4c27-8aaf-b9dbc98c1b13",
"exec": [
"pm.test(\"response has 1 elements\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -337,7 +331,6 @@
{
"listen": "test",
"script": {
"id": "4ea3441a-8a0f-421a-ba27-67ac1351775d",
"exec": [
"pm.test(\"response has 0 elements\", function () {",
" var jsonData = pm.response.json();",
Expand Down Expand Up @@ -372,6 +365,47 @@
}
},
"response": []
},
{
"name": "search for name a",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"response has 1 element\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.elements.length).to.eql(1);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{host}}/projects/ss/refs/master/search?name=a",
"host": [
"{{host}}"
],
"path": [
"projects",
"ss",
"refs",
"master",
"search"
],
"query": [
{
"key": "name",
"value": "a"
}
]
}
},
"response": []
}
],
"auth": {
Expand All @@ -388,7 +422,6 @@
{
"listen": "prerequest",
"script": {
"id": "a38d93e6-1de5-4875-8f80-a5a6cec3dcd4",
"type": "text/javascript",
"exec": [
""
Expand All @@ -398,13 +431,11 @@
{
"listen": "test",
"script": {
"id": "0866a69c-ea90-48f6-bedf-269b559b40d8",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"protocolProfileBehavior": {}
]
}