我必须在图书馆管理中使用高级搜索选项该如何编码? [英] I have to use advance search option in library management how to code it?

查看:67
本文介绍了我必须在图书馆管理中使用高级搜索选项该如何编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我有6个不同的字段供我搜索,如果我为用户提供了在6个选项中的任何一个中输入值的选项,或者输入组合字段如何使用sql查询来检索值.
例如,字段是作者,出版物,价格,主题,版本,书号
如果用户仅输入一个值,我可以搜索,但是如果用户输入多个(如果我尝试组合),那么会有很多组合.
请建议我如何定义查询?

Here is idea i have 6 different fields to allow search if i give the option for user to enter value in any of 6 option or enter combined fields how to use sql query to retrieve the value.
For example the fields are author, publication, price, subject, edition, bookid
and if user enter only one value i could search but if user enter more than one if i try combinations then there are many combination.
Please suggest me how to define the query?

推荐答案

在存储过程中,创建一个临时字段,将所有这些字段数据连接起来(逐行).然后在结果字段中搜索没有匹配的片段.
选择得分最高的1或10.

您可能希望得到更好的答案.我将其发布为选项之一.

我只是发布了一种方法,您可以尝试更好的方法或更改搜索策略,为每个字段分别添加框
In a stored procedure, create a temporary field which concatenate all these fields data (row wise). Then in the resulted field search any matching fragment is there are not.Score the matches.
Choose the best scored 1 or 10.

You may expect better answer. I am posting this as one of the option.

I just posted one way, you may try better ways or change your search strategy giving separate boxes for each fields


这篇关于我必须在图书馆管理中使用高级搜索选项该如何编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆