Hello community,
First, I apologize for my English.
I can not find a complex query.
I have thes columns :
Id : String
Name : String
FirstName : String
ZipCode : String
If a user perfoms a query : "*word1 *.... wordn"
I need to make a query, something like this :
Name contains word1 OR
FirstName contains word1 OR
ZipCode starts with word1
AND
....
AND
Name contains wordn OR
FirstName contains wordn OR
ZipCode starts with wordn
i make this query but it's not my real need :
{
- "query": {*
- "bool": {*
-
"must": [*
-
{*
-
"query_string": {*
-
"fields": [*
-
"name",*
-
"firstname",*
-
"zipcode"*
-
],*
-
"query": "*word1*"*
-
}*
-
},*
-
{*
-
"query_string": {*
-
"fields": [*
-
"name",*
-
"firstname",*
-
"zipcode"*
-
],*
-
"query": "*wordn*"*
-
}*
-
}*
-
],*
-
"must_not": [],*
-
"should": []*
- }*
- },*
- "from": 0,*
- "size": 10,*
- "sort": [],*
- "facets": {}*
*} *
This query is not good because I don't have my condition "zipcode start
with" but "zipcode contains".
Can someone help me build the right query ?
--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/882034da-08c4-4573-ac1a-c3d929ca1154%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.