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; ಬಳಸಿ 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; namespace Conchango { ವರ್ಗ InvokeSimpleFASTQuery { ಸ್ಥಿರ ಶೂನ್ಯವಾಗುವ Main(ದಾರ[] args) { #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); Console.WriteLine("Total results from search: [" + result.DocCount + "]."); ಇಂಟ್ docCounter = 0; ಸಮಯ (docCounter < result.DocCount) { docCounter ; IDocumentSummary thisDocSummary = result.GetDocument(docCounter); Console.WriteLine("[" + docCounter + "]: " + thisDocSummary.GetSummaryField("url").StringValue); } // ಸಮಯ Console.ReadLine(); #endregion } } }
It generates the following result:
</ಕೊನೆಯಲ್ಲಿ>
Alvin, 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?
ವಂದನೆ,
Alvin