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, ni hop, ruka na kuruka mbali wa kufuta mantiki hii ndani ya sehemu ya mtandao au ukurasa maombi:
kutumia Mfumo; kutumia System.Collections.Generic; kutumia System.Linq; kutumia System.Text; kutumia System.Collections.Specialized; kutumia Com.FastSearch.Esp.Search; kutumia Com.FastSearch.Esp.Search.Http; kutumia Com.FastSearch.Esp.Search.Navigation; kutumia Com.FastSearch.Esp.Search.Query; kutumia Com.FastSearch.Esp.Search.Result; kutumia Com.FastSearch.Esp.Search.View; kutumia System.Collections; namespace Conchango { darasani InvokeSimpleFASTQuery { tuli utupu Kuu(string[] args) { #kanda Initialize mawasiliano yetu na FAST ISearchFactory searchFactory; NameValueCollection nameValueCollection = mpya 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 Uzinduzi swala string queryString = "test"; Swala swala = mpya Swala(queryString); query.SetParameter(BaseParameter.Kuunganisha, uongo); query.SetParameter(BaseParameter.NAVIGATION, kweli); query.SetParameter(BaseParameter.NAVIGATION_DEEPHITS, 100); ISearchView SearchView; SearchView = searchFactory.GetSearchView("sharepointconn"); IQueryResult matokeo = searchView.Search(swala); Kuwafariji.WriteLine("Total results from search: [" + result.DocCount + "]."); int docCounter = 0; wakati (docCounter < result.DocCount) { docCounter ; IDocumentSummary thisDocSummary = result.GetDocument(docCounter); Kuwafariji.WriteLine("[" + docCounter + "]: " + thisDocSummary.GetSummaryField("url").Kamba Thamani); } // wakati Kuwafariji.ReadLine(); #endregion } } }
Inazalisha matokeo yafuatayo:
</mwisho>
Alvin, pengine figured hii nje tayari, lakini hapa unaendelea…
Sijui jibu, lakini mimi kukumbuka kwamba nilikuwa kupata maoni ya sifuri kwa sababu kitu ilikuwa na makosa katika suala la config server yangu bandari na kwamba aina ya kitu. Ni picky sana.
Got swali haraka kwa ajili ya wewe, Paulo. Nimekuwa kujaribu kujua jinsi ya kujenga maoni haya tafuta kama ni kuvaa kurudi 0 kwa GetSearchViewList().Hesabu. Unaweza kumweka yangu katika mwelekeo sahihi?
Shukrani,
Alvin