[WebForm] make good use of the practice of fast full-text search Search Service

[WebForm] make good use of the practice of fast full-text search Search Service


Many SharePoint features and complex, Search Service is just one of the services,

We set the business on a search service, now we have to make good use of this service,

I facilitate the rapid development of full-text search.

1. Add Service

Format: HTTP: // SERVER /_vti_bin/search.asmx

image

2. Test Search Service

Download SharePoint Search Service Tool, to help us through this tool to create and test the Query XML String

image

Enter ServerName

Establish Querypacket XML

image

I chose keyword analysis, and change the Records and Locale.

Test execution Querypacket XML

image

I chose to return a DataSet

Back to Results

image

After successful execution, copy the Query XML Base is added to the project and modify.

3. Project Reference Query Web Service

image

When you refer to the connection example MSDN Query Web Service NTLM error (as shown below) will appear, with Fiddler observe never return http 401 (Unauthorized),

And exactly the same program I moved WinForm Application Console or no problem (second step we use SharePoint Search Service Tool tests are normal)

image

The solution is more, I tested two methods, one is to use Sharepoint site certification Kerbers,

However, the certification will require Server and Client had to join a domain,

This comparison does not meet my current Policy (although it is more secure than NTLM, more efficient and more flexible),

Second, use NTLM authentication but using the WCF Service transmission, and this is what I currently used methods.

Web.config by adding the following section

image

Controller

[HttpPost]
        public ActionResult Index(FormCollection fs )
        {
            string keyword = fs["keyword"];
            QueryServiceSoapClient client = new QueryServiceSoapClient();
            //Use the credentials of the user running the client application:
            client.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
            client.ChannelFactory.Credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;       
            //Get Data
            System.Data.DataSet queryResults = client.QueryEx(GenQueryXml(keyword, "Filte", 1, 100));
            //automapper
            List _SearchModels = SourceTableMapping(queryResults.Tables[0]);

            return View(_SearchModels);
        }

result

Boolean queries

image

Precise query

image

Fuzzy query

image

reference

Walkthrough: Querying FAST Search Server From a Client Application

SharePoint Search Service Tool

Something that the SQL Server connection - Kerberos and NTLM

IIS detailed testing of various authentication

Original: Large column  [WebForm] make good use of the practice of fast full-text search Search Service


Guess you like

Origin www.cnblogs.com/chinatrump/p/11467091.html