Integrazzjoni SharePoint FAST: Tesegwixxi Mistoqsija sempliċi

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, huwa tal-ħops, skip u jaqbżu l bogħod biex nagħlaq din il-loġika ġewwa parti web jew paġna applikazzjoni:

użu Sistema;
użu System.Collections.Generic;
użu System.Linq;
użu System.Text;
użu System.Collections.Specialized;
użu Com.FastSearch.Esp.Search;
użu Com.FastSearch.Esp.Search.Http;
użu Com.FastSearch.Esp.Search.Navigation;
użu Com.FastSearch.Esp.Search.Query;
użu Com.FastSearch.Esp.Search.Result;
użu Com.FastSearch.Esp.Search.View;
użu System.Collections;

namespace Conchango
{
    klassi InvokeSimpleFASTQuery
    {
        statiku null Main(string[] args)
        {

            #reġjun Initialize komunikazzjoni tagħna ma FAST
            ISearchFactory searchFactory;

            NameValueCollection nameValueCollection = ġdid 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

             Titnieda tiftixa

            string queryString = "test";

            Mistoqsija query = ġdid Mistoqsija(queryString);

            query.SetParameter(BaseParameter.Clustering, falza);
            query.SetParameter(BaseParameter.NAVIGATION, vera);
            query.SetParameter(BaseParameter.NAVIGATION_DEEPHITS, 100);

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

            IQueryResult Riżultat = searchView.Search(query);

            Console.WriteLine("Total results from search: [" + result.DocCount + "].");

            int docCounter = 0;

            filwaqt li (docCounter < result.DocCount)
            {

                docCounter    ;

                IDocumentSummary thisDocSummary = result.GetDocument(docCounter);

                Console.WriteLine("[" + docCounter + "]: " + thisDocSummary.GetSummaryField("url").StringValue);

            } // filwaqt li

            Console.ReadLine();
            #endregion

        }
    }
}

Huwa jiġġenera-riżultat li ġej:

immaġni

</aħħar>

Abbona għall-blog tiegħi.

Tags: ,

2 ħsibijiet dwar "Integrazzjoni SharePoint FAST: Tesegwixxi Mistoqsija sempliċi

  1. Paul Galvin

    Alvin, inti probabilment dehret dan diġà, iżda hawnhekk tmur…

    I do not know-risposta, imma niftakar li kien I jkollna żero fehmiet minħabba xi ħaġa kienet żbaljata f'termini ta 'tiegħi konfigurazzjoni port server u li tip ta' ħaġa. Huwa ħafna picky.

  2. Alvin

    Ghandek xi mistoqsija quick għalik, Paul. Stajt ġiet jippruvaw biex issir taf kif toħloq dawn l-opinjonijiet tat-tiftix kif iżomm lura 0 għall GetSearchViewList().Għadd. Inti tista 'punt lili fid-direzzjoni t-tajba?

    Grazzi,
    Alvin

Ħalli Irrispondi

Your email address mhux se jkun ippubblikat. Meħtieġa oqsma huma mmarkati *