Tuesday, 15 January 2013

asp.net - Constructing a Windows Search query -



asp.net - Constructing a Windows Search query -

we have website in using windows search feature allow users search pages , documents of site. create search intuitive possible, given users familiar google-style search syntax. however, using windows search seems nowadays 2 problems.

if utilize freetext() predicate, users can come in google-style syntax options, such double quotes exact phrase matching or utilize minus sign exclude word. these features consider necessary. however, freetext() predicate seems demand every search term appear somewhere in page / document in order returned in results.

if utilize contains() predicate, users can come in search terms using boolean operators, , can execute wildcard searches using * character. however, search terms must joined 1 of logical operators or enclosed in double quotation marks.

what combination of two. users should able search exact phrases using double quotations marks, exclude words using minus sign, have not enclosed in quotation marks subject wildcard matching (e.g. searching civ homecoming documents containing words civil or civility or civilization).

how go implementing this?

i followed of instructions @ http://www.codeproject.com/articles/21142/how-to-use-windows-vista-search-api-from-a-wpf-app create interop.searchapi.dll assembly .net. used isearchqueryhelper.generatesqlfromuserquery() method build sql command.

the generated sql uses contains() predicate, builds contains() predicate numerous times different combinations of search terms, including wild cards. allows user come in exact phrases using double quotation marks, exclude words using minus sign, , perform automatic wildcard matching mentioned in original question.

asp.net windows-search

No comments:

Post a Comment