Recently, I migrate MySQL database to Elasticsearch.
and its basically dump of million resumes.
Now, I am using official PHPClient API to interact with Elasticsearch.
FYI,
below is my cluster index fields
[name, email, state, resume_text, visa]
I have few questions. I tried searching online resources to tweak my search.
But could not meet with my requirement.
Below is the issues, I am head on wall to it.
Issue 1 :
tried to search "content management system"
with field resume_text
could get the desired result, the search result is worst, sometimes cant even find "content", "management" or "system"
few resumes.
So, with <2
words, its returns bad result set.
Below is the syntax, i got from documentation and other resources
$searchParams['body']['query']['bool']['must'] = array('match' => array('resume_text' => $skill_name));
I tried even term
, but not good result.
I dont know, what I did wrong.
Issue 2 :
I need to get the resumes, with respect to location i.e. "state".
I tried to search with <1
state, it doesnt give proper results. I get other states resumes too.
only one state works perfect.
Alabama and Alaska, it should get me only these two results
$searchParams['body']['query']['bool']['should']['term'] = array('cur_state' => $state_name);
Issue 3 : [ Not an issue, a doubt ]
Can we search results from field to a variable.
For example.
$visa_variable = "Citizen, Green Card, H1B";
now, how can we search relating to 3 words in variable without spliting or explode in php then
searching independently .
Hmm. thats it. thanks