I have the following (simplified) mapping:
{
"settings": {
"index": {
"number_of_shards": "2",
"number_of_replicas": "1"
},
"analysis": {
"analyzer": {
"rebuilt_whitespace": {
"tokenizer": "whitespace",
"filter": ["lowercase"]
}
}
}
},
"mappings": {
"properties": {
"tags": {
"fielddata": true,
"type": "text",
"analyzer": "rebuilt_whitespace",
"fields": {
"length": {
"type": "token_count",
"analyzer": "rebuilt_whitespace"
}
}
},
"category": {
"type": "text",
"fields": {
"raw": {
"type": "keyword"
}
}
}
}
}
}
Say I have a query like "c++ programming" I'd like to be able to have results that match "programming" in category and "c++" in tags (but not "c"). Using cross_fields (with multi_match or query_string) to do this doesn't work as they are using different analyzers. Anything else I have been able to find seem to go on compromise on something else. Also note I have more fields than those listed here, so doing "exhaustive" matching won't work.
Basically I want to be able to perform:
+(tags:programming | category:programming) +(tags:c++ | category:c)
Note the different analyzers used for "c++". Is this possible?