Is it possible to make phrase searches for multi-word synonyms in Elasticsearch?
Let's say I have this synonym:
strip steak bacon, ssb, strip-steak bacon
And this text in a document:
Kevin burgdoggen turkey, spare ribs pancetta pastrami drumstick strip steak bacon beef ribs pork.
Jowl sirloin tenderloin hamburger alcatra short loin biltong cow doner ribeye tri-tip sausage bacon
capicola pork. Filet mignon meatloaf shoulder cupim tongue meatball. Shankle cow strip steak tail pig
buffalo pork picanha cupim porchetta kielbasa beef. Ground round pork loin filet mignon turducken.
Beef pancetta buffalo strip steak, ground round salami flank porchetta hamburger chicken turducken
venison sirloin pastrami.
I query the index for ssb
plain and simple:
"query": {
"match": {
"body": "all the ssb are belong to us"
}
}
Then I want it to be interpreted as:
all the "strip steak bacon" are belong to us
Otherwise I will get the results and highlights based on all words (all, the, strip, steak, bacon, are, belong, to, us
).
Is this even possible to do? I have tried to find docs on this, but they all go the other way using directional synonyms (strip steak bacon => ssb
). Now I am seriously considering adding it to my application logic instead of doing it in Elasticsearch, and replacing ssb
's in the query manually which feels like a really bad idea.