Hi,
You have to supply the name of the field for both words.
name:Massachusetts name:Insti , Otherwise it will search for Insti in your
defaul search field.
....../university/_search?q=name:Massachusetts%20name:Insti&fields=name
The match query does this for you.
Regards /Johan
Den fredagen den 24:e januari 2014 kl. 07:02:53 UTC+1 skrev paul:
>
> Hi ,
>
> I am testing the below two queries but it gives different results
>
> *Query 1:*
> ......./university/_search?q=name:Massachusetts%20Insti&fields=name
>
> *Query 2:*
> {"size": 10,
> "fields": [
> "name"
> ],
> "query": {
> "match": {
> "name": {
> "query": "Massachusetts Insti"
> }
> }
> }
>
> I believe space between the words is causing problem , how to represent
> the query string in *Query 2* in* Query 1 *i tries "+: "%20" for
> representing spaces.
>
> Regards
> Avinash
>
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/1388fcd8-b188-44d4-acd5-925175b46849%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.