Silverlight Document Search Engine

Post on 20-Aug-2015

2.158 views 0 download

Transcript of Silverlight Document Search Engine

Silverlight Document search engine

Mustaţă Bogdan

mustata.bogdan@rms.ro | RomSoft

March 2010

Agenda

1. Lucene

1. Silverlight overview

1. Demo & Code

Intelligent Crawling and Indexing using Lucene

Searching

Looking up words in an indexFactors Affecting Search:

Precision – How well the system can filterSpeedSingle, Multiple Phase queries, Results ranking, Sorting, Wild card queries, Range queries support

Indexing

Sequential Search is bad (Not Scalable)Index speeds up selection Index is a special data structure which allows rapid searching.Different Index Implementations

- B Trees- Hash Map

Search Process

Query

Hits

Docs

Docs

Index

Indexing API

Lucene

High-performance, full-featured text search engine libraryWritten 100% in pure java & C#Easy to use yet powerful APIJakarta Apache Product. Strong open source community support.

Why Lucene?

Open source (Not proprietary)Easy to use, good documentationInteroperable - Ex: Index generated by java can be used by VB, asp, perl applicationPowerful And Highly ScalableIndex Format

Designed for interoperabilityWell DocumentedResides on File System, RAM, custom store

Indexing With LuceneWhat type of documents can be indexed?

Any document from which text can be fetched and extractedover the net with a URL

Uses Inverted Index

The index stores statistics about terms in order to make term based search more efficient.

http://lucene.apache.org/lucene.net/

Demo

SilverlightOverviewcross-browsercross-platformcross-device

Plug-in for building and delivering the next generation of

.NET based

media experiencesand

rich interactive applications

for the Web

BrowserDevices, Mobile

DesktopServer & Services

Silverlight is a .NET technology

.NET

Silverlight extends your .NET Reach.

Silverlight 1.0 BetaSilverlight 1.1 Alpha

Silverlight 1.0 Silverlight 2 Beta

Silverlight 3 Beta Silverlight 3 Silverlight 4 Beta

Silverlight 2

Silverlight 4

A Brief History of Silverlight

MIX 07 Sep 07 MIX 08

MIX 09 Jul 09 PDC 09

Oct 08

Spring 10

Silverlight 1.0

X-BrowserX-Platform

Designer / Developer Workflow

High Quality Audio/Video

Auto-UpdaterAnimation &

Vector Graphics

Skills Reuse(AJAX)

Silverlight 2

High Performance

Runtime

Flexible Data Access

Rich UI Controls & Deep Zoom

Content Protection

Robust Networking

Role-Based Tools & DLR

Silverlight 3

Out of Browser GPU Acceleration

Navigation & Validation

H.264 / AACPerspective

Transforms & Pixel Shaders

Silverlight Toolkit

Silverlight 4

Elevated Trust Printing Webcam / Mic

Rich Text & HTML Hosting

Input Improvements

Localized to 41 Languages

Presentation Core – Graphics 2D Graphics

Vector based Standard shapes and Paths Masking and clippingTransformations: skew, rotate, scale, translate, matrix

Animation BasicsTime-based Support linear, discrete and spline animationAnimatable property types:

Double, Color, PointAnimations and graphics can be defined using XAML or code

Declarative Programming Through XAMLExtensive Application Markup Language

Toolable, declarative markupCode and content are separateCompatible with Windows Presentation Foundation

<Button Width="100"> OK<Button.Background>LightBlue</Button.Background></Button>

XAMLButton b1 = new Button();b1.Content = "OK";b1.Background = new SolidColorBrush(Colors.LightBlue);b1.Width = 100;

C#Dim b1 As New Buttonb1.Content = "OK"b1.Background = New _SolidColorBrush(Colors.LightBlue)b1.Width = 100

VB.NET

Databinding Two way data binding from User interface to business objects Notification via INotifyPropertyChangedDataContext is inherited via Visual Tree

From XAML <TextBlock Text="{Binding Nasdaq.Points, Mode=OneWay}"/>

From code Binding binding = new Binding("Nasdaq.Points");binding.Mode = BindingMode.OneWay;TextBlock tb = new TextBlock();tb.SetBinding(TextBlock.TextProperty, binding);

Networking Asynchronous HTTP requests

GET/POST Access to most headers, cookies,

Uses browser networking stack Caching, authentication, proxy , compression

Web ServicesSOAP 1.1

Basic profileA few restrictions (e.g. SOAP Faults not supported)

Asynchronous invocationFollows cross-domain policy restrictionsGenerated proxies support data binding

Sockets TCP only Asynchronous API No explicit bind and no listen/accept support Restricted ports ( 4502-4534) Cross Domain based on provisioning server

void Connect(AddressFamily family){SocketAsyncEventArgs connectArgs = new SocketAsyncEventArgs();connectArgs.RemoteEndPoint = new DnsEndPoint(Application.Current.Host.Source.Host, 4502);connectArgs.Completed += new EventHandler<SocketAsyncEventArgs>(OnConnectCompleted);socket = new Socket(family, SocketType.Stream,ProtocolType.Tcp);if (!socket.ConnectAsync(connectArgs))OnConnectCompleted(socket, connectArgs);}

Cross-domain support 2 formats:

Flash policy fileSilverlight policy file

<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd"><cross-domain-policy><allow-access-from domain="*" /></cross-domain-policy>

Cross-domain.xml

clientaccesspolicy.xml

<?xml version="1.0"?><access-policy><cross-domain-access><policy><allow-from><domain uri="http://customers.shop.com”/>"<domain uri="http://partner.com/app.xap"/></allow-from><grant-to><grant path="/sales/serialnumbers.xml" /><grant path="/partners" include-subpaths="false"/> </grant-to></policy></cross-domain-access></access-policy>

Isolated StorageStream based access to a private file/directory structurePatterned after .NET Framework IsolatedStorage classesRead and write string or binary dataStore is per application XAPApplication code to request size increase

User prompt to accept quota increaseQuotas fall into predetermined size slotsCode must initiate increase size call from within user input/event

Designer/Developer Collaboration

Desktop

Media& RIA

Server, Services

Tooling

DesignerLook, behavior, brand,and emotional connection

DeveloperFunction, deployment, data,

security, operational integrity

Server Vista

XAML

Silverlight and WPF

Silverlight is related to WPF Plus a few extra web features and its own codecs

Reuse strategy Same skills Same tools Same XAML and UI Silverlight code should run on WPF with minor changes

Silverlight and .NET: Better TogetherHighly productive development framework

Multi-language supportLatest developer innovations (e.g. LINQ, Generics)AJAX integration

Great tools Visual StudioExpression Studio

Cross-platform & cross-browser pluginWorks with Safari, Firefox, Google Chrome and Internet Explorer Mac OS X and WindowsAny web serverFast, easy install process

Securely extends your web browser’s sandbox Off-line storage, OpenFileDialog, Sockets, cross-domain

Demo

Q&A

ContactMustaţă Bogdanmustata.bogdan@rms.ro

Linkshttp://silverlight.net/http://team.silverlight.net/http://www.silverlightshow.net/MS Expression Studio 3: http://www.microsoft.com/expression/products/Studio_Overview.aspxSilverlight HandsOnLabs: http://silverlight.net/learn/handsonlabs/Introduction to Silverlight Labs: http://www.microsoft.com/education/facultyconnection/articles/articledetails.aspx?cid=1988&c1=en-us&c2=03 Day Deep Dive into Silverlight: http://www.microsoft.com/education/facultyconnection/articles/articledetails.aspx?cid=2023&c1=en-us&c2=0