0

I send the request:

GET http://localhost:9200/test1/group/_search?q=White House

And I get this responsse:

        {
            "_index": "test1",
            "_type": "group",
            "_id": "Bs3LqmIBHyTtDqASiuXU",
            "_score": 4.5936766,
            "_source": {
                "group": "bank 3",
                "type": "comment",
                "data": "White House",
                "author": "author 13"
            }
        },
        {
            "_index": "test1",
            "_type": "group",
            "_id": "Zs11r2IBHyTtDqAS8OXf",
            "_score": 3.2117434,
            "_source": {
                "group": "bank 2",
                "type": "task",
                "data": "White",
                "author": "author 1"
            }
        }

How to write a query that return only White House?

Chin Huang
  • 12,912
  • 4
  • 46
  • 47

2 Answers2

0

I think you should try '+' or %20 as space character.

https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Alternatively if it's possible send a properly formatted HTTP request.

MrSimple
  • 599
  • 4
  • 14
0

Enclose the text White House in quotation marks. That way, a phrase search is performed. Like so:

_search?q="White House"

By default it's a match search, which looks for any of the words.

areyesram
  • 169
  • 2