This is a continuation in my FAST coding mini-series for SharePoint folk. The bit of code below executes a search for the term "test" in FAST via a Console application. Obviously, જો તે હોપ છે, અવગણો અને વેબ ભાગ અથવા એપ્લિકેશન પાનું અંદર આ તર્ક લપેટી દૂર કૂદકો:
નો ઉપયોગ પદ્ધતિ; નો ઉપયોગ System.Collections.Generic; નો ઉપયોગ System.Linq; નો ઉપયોગ System.Text; નો ઉપયોગ System.Collections.Specialized; નો ઉપયોગ Com.FastSearch.Esp.Search; નો ઉપયોગ Com.FastSearch.Esp.Search.Http; નો ઉપયોગ Com.FastSearch.Esp.Search.Navigation; નો ઉપયોગ Com.FastSearch.Esp.Search.Query; નો ઉપયોગ Com.FastSearch.Esp.Search.Result; નો ઉપયોગ Com.FastSearch.Esp.Search.View; નો ઉપયોગ System.Collections; નામસ્થળ Conchango { વર્ગ InvokeSimpleFASTQuery { સ્થિર ગેરમાન્ય મુખ્ય(સ્ટ્રિંગ[] વિકલ્પોલેછે) { #region Initialize our communication with FAST ISearchFactory searchFactory; NameValueCollection nameValueCollection = નવું NameValueCollection(); nameValueCollection.Add("fastsearchengine", "Com.FastSearch.Esp.Search.Http.HttpSearchFactory"); nameValueCollection.Add("Com.FastSearch.Esp.Search.Http.QRServers", "fastdemoback:15100"); nameValueCollection.Add("Com.FastSearch.Esp.Search.Http.RequestMethod", "GET"); searchFactory = SearchFactory.NewInstance(nameValueCollection); #endregion #region Launch a query સ્ટ્રિંગ queryString = "test"; પ્રશ્ન query = નવું પ્રશ્ન(queryString); query.SetParameter(BaseParameter.CLUSTERING, ભૂલ ખવડાવનારું); query.SetParameter(BaseParameter.NAVIGATION, સાચું); query.SetParameter(BaseParameter.NAVIGATION_DEEPHITS, 100); ISearchView searchView; searchView = searchFactory.GetSearchView("sharepointconn"); IQueryResult result = searchView.Search(query); કન્સોલ.WriteLine("Total results from search: [" + result.DocCount + "]."); ઈન્ docCounter = 0; સમય (docCounter < result.DocCount) { docCounter ; IDocumentSummary thisDocSummary = result.GetDocument(docCounter); કન્સોલ.WriteLine("[" + docCounter + "]: " + thisDocSummary.GetSummaryField("url").StringValue); } // સમય કન્સોલ.ReadLine(); #endregion } } }
It generates the following result:
</અંત>
એલ્વિન, you probably figured this out already, but here goes…
I don’t know the answer, but I recall that I was getting zero views because something was wrong in terms of my server port config and that sort of thing. It’s very picky.
Got a quick question for you, પોલ. I’ve been trying to find out how to create these search views as it keeps returning 0 for GetSearchViewList().Count. Can you point me in the right direction?
આભારદર્શક શબ્દો,
એલ્વિન