Closed daviddean99 closed 3 years ago
On a related note, I've noticed that in sorting the results for keyword "recruiter", it lists a exact matching job title "recruiter" first, but after that it seems to list additional job titles containing the keyword "recruiter at random.
Is it possible to sort results so that results are ordered by how far from the start of the results the keyword presents?
For example, current behaviour:
Search term: "recruiter" provides results:
"Recruiter"
"Employment Recruiter"
"Blood Donor Recruiter Supervisor"
"Executive Recruiter"
"Personnel Recruiter"
"HR Recruiter (Human Resources Recruiter)"
"Job Recruiter"
If results could be ordered by distance from start of record then it would look something like this:
Search term: "recruiter" should provide results:
"Recruiter" <----- Exact match
"HR Recruiter (Human Resources Recruiter)" <--- Next closest match from start of record
"Job Recruiter"
"Executive Recruiter"
"Personnel Recruiter"
"Employment Recruiter"
"Blood Donor Recruiter Supervisor"
Please change over to the version >= 0.7.x, thanks a lot.
Also please consider using the option suggest: true
within passed search options.
I have an index of job titles like this:
...and I'm using these settings to build the search index:
...and the search parameters are all default apart from limiting to 10 results:
filterResults = index.search(searchQuery, 10);
If someone searches for "Recruiter" then all matching job title are being returned, regardless of where in the title the word "Recruiter" is. That's perfect.
The problem is where someone searches for a job title that starts with another word, for example "Technical Recruiter" or "Internal Recruiter". In that case the leading word is not matched so FlexSearch does not return any matches.
In this case I would like FlexSearch to still return matches for the word "Recruiter" even if the previous word e.g. "Internal" does not have any matches.
I guess the problem is that FlexSearch is treating the entire two word entry as one search term, instead of searching first for an exact match "Internal AND Recruiter" then trying the words separately i.e. "Internal OR Recruiter".
Is this possible with FlexSearch?