それはおそらく本当に簡単です。だから、私はフィールド「full_name」を持つこのテーブル、ユーザーを持っています
次のようなエントリがあるとします
"John Doe"
"Jane Doe"
"Colby Smith Jr"
"Apple Smith"
これらの条件に適合する正規表現検索が必要です。
query = John => return 'John Doe'
query = Doe => return 'John Doe', 'Jane Doe'
query = Apple => return 'Apple Smith'
query = Smith => return 'Colby Smith Jr', 'Apply Smith'
query = Apple Smith => return 'Apple Smith'
query = Smith Jr => return 'Colby Smith Jr'
基本的に、クエリを検索する正規表現関数が必要です * (* はワイルドカードですか?)
OR (結果文字列のスペースの後の最初の文字)クエリ
それは理にかなっていますか?
基本的に、インスタグラムの検索機能を真似ようとしています。できればチェックしてください。