
External links
Shimano
Category:Manuals and manuals of fishing equipmentQ:
Elasticsearch - Query/Search a string for any of the values from a list
I have an elasticsearch field that has values in a list. Each item in the list can be a "M" or a "F" type of a value. I want to be able to query and search the field to find all the records that match a given string. So the search could be something like this:
MatchAllQueryBuilder queryBuilder = QueryBuilders.matchAllQuery();
Or this:
MatchAllQueryBuilder queryBuilder = QueryBuilders.queryStringQuery(query);
Where the query is just the search string. I've tried using a regex matchAllQuery like this:
MatchAllQueryBuilder queryBuilder = QueryBuilders.matchAllQuery();
queryBuilder.query(query);
However, it seems that the list values for the fields is not being used. I can see it as a problem with regexbys, but I can't seem to figure out how to get the regex search working. Does anyone have any ideas?
Thanks in advance!
A:
When using a matchAllQuery you can put the types in a nested list
For example:
"match":{
"query":{
"match_all":{}
},
"types":{
"doc":{
"properties":{
"title":{
"type":"string"
},
"foo":{
"type":"list" be359ba680
Related links:
Comments