Multi_Match filter by _type?


(Garrett Johnson) #1

I have an index created by the JDBC river that contains types of objects:

Orders, Accounts etc.

If I execute the boosted multimatch query below I get back 50 of each type
of result. All is well.

However I'm trying to give the option to filter the list by user control
and lets say i only want to search one type or ... as many as I want.

I tried using Filtered but couldn't get the syntax to work for me.

Thanks for you help.

{
"query": {
"multi_match": {
"fields": [
"Name^5",
"Id^20",
"*Name^5",
"Title^5",
"Subject^5",
"Domain^5",
"_all"
],
"query": "mysearch",
"type": "best_fields",
"use_dis_max": "false"
},

},
"from": 0,
"sort": [],
"size": 50,
"aggs": {
"top-types": {
"terms": {
"field": "_type"
},
"aggs": {
"top_type_hits": {
"top_hits": {
"size": 50
}
}
}
}
}
}

--
Please update your bookmarks! We have moved to https://discuss.elastic.co/

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/28b428b1-3690-4f0c-a438-92c9d98a55e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2