Skip to content

Getting Started

Giacomo Stelluti Scala edited this page Dec 31, 2019 · 13 revisions

Install

A version quite aligned to GitHub repository can be downloaded from NuGet. It follows the command of .NET Core` CLI tool:

$ dotnet add package PickAll --version 0.17.0-alpha

This will install the specified version of PickAll. In a similar way can be done from Visual Studio Package Manager Console:

PM> Install-Package PickAll -Version 0.17.0-alpha

Context

Each a predefined set of searches or post processing events (defined service) must occur on a search context (SearchContext type). You can get one using Default preconfigured singleton:

var context = SearchContext.Default;

This is the equivalent of:

var context = SearchContext()
                  .With<Goolge>()
                  .With<DuckDuckGo>()
                  .With<Uniqueness>()
                  .With<Order>();

This will create a context that will search results on Google and DuckDuckGo. URL of results will be unique and ordered by description. Something similar can be easly done using the F# friendly constructor:

let context = new SearchContext(typeof<Google>,
                                typeof<DuckDuckGo>,
                                typeof<Uniqueness>,
                                typeof<Order>)

There are also other means to configure services, but no result is created until a call to SearchAsync:

var query = "human archetypes";
var results = await context.SearchAsync(query);
Clone this wiki locally