Entegrasyon SharePoint RAPIDE: Egzekite yon senp Requête

Sa se yon kontinyasyon nan bwat tou PWEPARE m' codage ti-seri pou peyi SharePoint. Moso kòd ki pi ba s' yon rechèch pou manda a "tès" nan bwat tou PWEPARE via yon aplikasyon konsole. Evidamman, li se yon sote, pase sou Et vole ale nwobe lojik sa a anndan yon pati entènèt ou paj aplikasyon:

itilize Sistèm;
itilize System.Collections.Generic;
itilize System.Linq;
itilize System.Text;
itilize System.Collections.Specialized;
itilize Com.FastSearch.Esp.Search;
itilize Com.FastSearch.Esp.Search.Http;
itilize Com.FastSearch.Esp.Search.Navigation;
itilize Com.FastSearch.Esp.Search.Query;
itilize Com.FastSearch.Esp.Search.Result;
itilize Com.FastSearch.Esp.Search.View;
itilize System.Collections;

espace Conchango
{
    klas InvokeSimpleFASTQuery
    {
        menm jan vid Pwensipal(filè[] args)
        {

            #rejyon Initialiser nou kominikasyon ak Bwat tou PWEPARE
            ISearchFactory searchFactory;

            NameValueCollection nameValueCollection = nouvo 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", "OBTENIR");

            searchFactory = SearchFactory.NewInstance(nameValueCollection);

            #endregion #region Lanse yon requête

            filè queryString = tès"";

            Requête requête = nouvo Requête(queryString);

            requête. SetParameter(BaseParameter.CLUSTERING, pa vre);
            requête. SetParameter(BaseParameter.NAVIGASYON, vre);
            requête. SetParameter(BaseParameter.NAVIGATION_DEEPHITS, 100);

            ISearchView searchView;
            searchView = searchFactory.GetSearchView("sharepointconn");

            IQueryResult rezilta = searchView.Search(requête);

            Konsole.WriteLine("Total rezilta yo nan rechèch: [" + rezilta. DocCount + "].");

            int docCounter = 0;

            moman (docCounter < rezilta. DocCount)
            {

                docCounter    ;

                IDocumentSummary thisDocSummary = rezilta. GetDocument(docCounter);

                Konsole.WriteLine("[" + docCounter + "]: " + thisDocSummary.GetSummaryField(adrès entènèt"").StringValue);

            } // moman

            Konsole.ReadLine();
            #endregion

        }
    }
}

Li génère rezilta sa a:

imaj

</fen>

Vous pou m' blog.

Technorati baj: ,

2 refleksyon sou "Entegrasyon SharePoint RAPIDE: Egzekite yon senp Requête

  1. Paul Galvin

    Alvin, ou kapab byen sipoze sa deja, Men, pase isit la…

    M pa konn repons, Men, mwen rantre sa mwen t' ap pwen de vi zewo paske se yon bagay ki te mal pase tèm config pò sèvè m' ak sa kalite bagay. Trè picky.

    N. repons
  2. Alvin

    Achte yon kesyon rapid pou ou, Paul. Mwen te gen tap eseye pou chèche konnen kijan pou kreye vues recherche sa yo menm jan li fè retounen 0 pou GetSearchViewList().Konte. Èske w ka montre m' nan bon direksyon?

    Mèsi,
    Alvin

    N. repons

kite yon repons

Adrès imèl ou pa pral dwe pibliye. Jaden obligatwa yo make *