Phrase search not as expected

Manticore v3.6

I am having unexpected behaviour with this query:

SELECT cvid,WEIGHT() as weight FROM index WHERE MATCH(’“pr manager”’) ORDER BY weight DESC LIMIT 0,50 OPTION max_matches=50, ranker=expr(‘sum((4lcs+2(min_hit_pos==1)+exact_hit)*user_weight)1000+bm25-7diffindays’), field_weights = (title=5,summary=3)

my results include the following:

  • Project Manager, Technical Engineer
  • Junior Product Marketing Manager, Advanced use of Microsoft Office, portfolio management skills.

So I am searching for “pr manager” and the results include “Project Manager” and “Product manager”.

I would expect that using double quotes would only include only the exact phrase.

Any ideas? thx!

Do you perhaps have min_infix_len (or min_prefix_len) set on the index? Perhaps with expand_keywords?

… so the query gets in effect ‘expanded’ to MATCH(’“*pr* manager”’) which then matches part words.

The ‘phrase operator’ only makes it so matches those keywords adjacent. (ie one then other) - doesn’t enforce them to be an ‘exact’ match, bypassing wordforms/morphology, and even part word matches.

Using index_exact_words would allow you to use the exact form operator, to bypass keyword expansion.

So could then run WHERE MATCH(’“=pr manager”’)

Then ‘=pr’ would only match explicitly ‘pr’, rather than anything that starts with (or contains ‘pr’)

My current settings are:

min_infix_len 		= 2
min_prefix_len	= 1
expand_keywords 	= 1
index_exact_words = 1

Do have to change something in the settings or my query?

could you issue your query with profiler enabled to see the matching tree?

set profiling =1;
select * ...
show plan;

and also check terms matched from your query

select * ...
show meta;

I fixed it by adding the = after every non even quote in the search string.

I don’t like this solution, but it works.

you could disable expand_keywords for your index or add option expand_keywords=0 for all your phrase queries