I'm working with Elastic Search in Laravel my index has 3 fields text,mood,haloha_id.
First I want to match "haloha_id"(consider haloha_id as post and text as comments on that post) if match then do further matching.
suppose "haloha_id" is matched now I want to match a substring in the "text" field then match "mood"(which is integer either 0,1,2 etc) "mood should be matched only if some of "text" is matched otherwise not.I'm making Like Mine query mean comments matching with user's comments for the specific post will be shown only. The issue in my query is that
My own Comments doesn't appear to the top hence its matched 100%
If someone "mood" and "comments" matched 100% to mine then it doesn't appear to the top.
I removed "mood" related query but score has no effect it means score doesn't include mood matched score.
Here is my query.
"query"=>[
"bool"=>[
"should"=>[
"match"=>[
"text"=>[
"query"=>$userHaloha->filtered_text,
"fuzziness"=>"AUTO",
]
]
],
"minimum_should_match"=>1,
"must"=>[
"match"=>[
"mood"=>$userHaloha->mood,
],
"match"=>[
"haloha_id"=>$userHaloha->haloha_id
]
]