Multiple / Selective SQL Queries

How can I make multiple / singular words stretch all forms?

Example. If a person is looking for “male rings”, how can I check the database to find out if any of the fields contain male, male, male, rings, rings, etc.?

+3
source share
3 answers

It doesn't seem like using LIKE would be the best approach to what you need. I would look at MySQL FULLTEXT indexing to get basic functionality. I will need to study the plural a bit more to see if this can be done.

Take a look at these two links for FULLTEXT indexing information.

:

SELECT headline, story FROM news
WHERE MATCH (headline,story) AGAINST ('Hurricane');

UPDATE:

SO , , , , FULLTEXT , , . FULLTEXT?

+4

Sphinx full-text MySQL (. ).

Porter Stemmer [2] [3], , "" , "" , "" "" "" (. wiki).

+3
select * from index_table where item_name rlike '[[:<:]]preform[s]*[es]*[ies]*[[:>:]]';

, . . , 90-95% .

Cheers, Ashish

+1

Source: https://habr.com/ru/post/1751089/


All Articles