如何在多个表中搜索项目

时间:2022-08-24 19:46:47

Recently i am into E-commerce application, here i want to search the products according to category name or sub category name or product name. here i am planning to create table for Category, subcategory and products. If i search for an item, that can be category name or sub category name or product name, accordingly the products should be displayed.

最近我进入电子商务应用程序,在这里我想根据类别名称或子类别名称或产品名称搜索产品。在这里,我打算为类别,子类别和产品创建表格。如果我搜索项目,可以是类别名称或子类别名称或产品名称,则应显示产品。

Eg. Men-Shirt-Peterengland/Levis/john player/

例如。男子衬衫 - Peterengland / Levis / john球员/

If i search the text 'shirt' all the products(Peterengland/Levis/john player/) should be displayed. If i search perterengland ,only that product to be displayed. If i search with the main category all the subcategories and all products under this sub categories should be displayed.

如果我搜索文本“衬衫”,则应显示所有产品(Peterengland / Levis / john player /)。如果我搜索perterengland,只显示该产品。如果我使用主类别搜索所有子类别,则应显示此子类别下的所有产品。

Help me if any one have an idea on it.

如果有人对此有所了解,请帮助我。

1 个解决方案

#1


0  

You can achieve this in SQL with Full-Text Search, you can query multiple tables with multiple words.

您可以使用全文搜索在SQL中实现此功能,您可以使用多个单词查询多个表。

If you prefer your search logic to stay in C#, there are .NET search libraries, Lucene.Net is one of the most popular.

如果你更喜欢你的搜索逻辑留在C#,有.NET搜索库,Lucene.Net是最受欢迎的。

#1


0  

You can achieve this in SQL with Full-Text Search, you can query multiple tables with multiple words.

您可以使用全文搜索在SQL中实现此功能,您可以使用多个单词查询多个表。

If you prefer your search logic to stay in C#, there are .NET search libraries, Lucene.Net is one of the most popular.

如果你更喜欢你的搜索逻辑留在C#,有.NET搜索库,Lucene.Net是最受欢迎的。