How to search across multiple types whose names start with a prefix?


#1

Hi folks

I've been looking in vain today for a way to search or filter documents across multiple types in an index by specifying those type names with a prefix or wildcard. Is this possible?

You can query in specific types supplied in the URL, you can build a filter query, but I couldn't find how to apply a prefix on the type.

Anything I missed?

Barring support from the API, the only solution I can imagine is to specify the type name as part of a document field such as the _id and then apply a prefix query for that field, but it's rather arcane.

Thanks
Fritz


#2

I eventually answered my own question, see below. I was trying to figure out how to apply a prefix to the "type filter" which spells the type as "type", whereas I could just issue a regular prefix query for the "_type" field

"filter": {
"prefix": {
"_type": "IndexTypePrefix"
}
}


(system) #3