Note that there are some explanatory texts on larger screens.

plurals
  1. POUnexpected behaviour in MySQL with Boolean-Mode-Query with quoted hyphenated string
    primarykey
    data
    text
    <p>I have a problem or rather an understanding problem with a hyphenated searchstring which is quoted.</p> <p>In my Table there is a table with a column 'company'.<br> One of the entries in that column is: <strong>A-Z Electro</strong></p> <p>The following examples are simplified a lot (though the real query is much more complex) - but the effect is still the same.</p> <p>When I do the following search, I don't get the row with the above mentioned company:</p> <pre><code>SELECT i.* FROM my_table i WHERE MATCH (i.company) AGAINST ('+\"A-Z\" +Electro*' IN BOOLEAN MODE) GROUP BY i.uid ORDER BY i.company ASC LIMIT 0, 40; </code></pre> <p>If I do the following search, get the row with the above mentioned company (notice only changed the - to a + before \"A-Z\":</p> <pre><code>SELECT i.* FROM my_table i WHERE MATCH (i.company) AGAINST ('-\"A-Z\" +Electro*' IN BOOLEAN MODE) GROUP BY i.uid ORDER BY i.company ASC LIMIT 0, 40; </code></pre> <p>I also get the row, if I remove the operator completely:</p> <pre><code>SELECT i.* FROM my_table i WHERE MATCH (i.company) AGAINST ('\"A-Z\" +Electro*' IN BOOLEAN MODE) GROUP BY i.uid ORDER BY i.company ASC LIMIT 0, 40; </code></pre> <p>Can anyone explain to me this behaviour? Because I would expect, when searching with a +, I should get the result too...</p> <p><strong>EDIT</strong></p> <p>I just checked the table index with myisam_ftdump. Two-Character-Words are indexed properly as there are entries like<br> 14f2e8 0.7908264 ab<br> 3a164 0.8613265 dv </p> <p>There is also an entry:<br> de340 0.6801047 az<br> I suppose this should be the entry for A-Z - so the search should find this entry, shouldn't it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload