silverlight document search engine

31
Silverlight Document search engine Mustaţă Bogdan [email protected] | RomSoft March 2010

Upload: mustata-bogdan

Post on 20-Aug-2015

2.158 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Silverlight Document Search Engine

Silverlight Document search engine

Mustaţă Bogdan

[email protected] | RomSoft

March 2010

Page 2: Silverlight Document Search Engine

Agenda

1. Lucene

1. Silverlight overview

1. Demo & Code

Page 3: Silverlight Document Search Engine

Intelligent Crawling and Indexing using Lucene

Page 4: Silverlight Document Search Engine

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

Page 5: Silverlight Document Search Engine

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

Page 6: Silverlight Document Search Engine

Search Process

Query

Hits

Docs

Docs

Index

Indexing API

Page 7: Silverlight Document Search Engine

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.

Page 8: Silverlight Document Search Engine

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

Page 9: Silverlight Document Search Engine

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/

Page 10: Silverlight Document Search Engine

Demo

Page 11: Silverlight Document Search Engine

SilverlightOverviewcross-browsercross-platformcross-device

Plug-in for building and delivering the next generation of

.NET based

media experiencesand

rich interactive applications

for the Web

Page 12: Silverlight Document Search Engine

BrowserDevices, Mobile

DesktopServer & Services

Silverlight is a .NET technology

.NET

Silverlight extends your .NET Reach.

Page 13: Silverlight Document Search Engine

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

Page 14: Silverlight Document Search Engine

Silverlight 1.0

X-BrowserX-Platform

Designer / Developer Workflow

High Quality Audio/Video

Auto-UpdaterAnimation &

Vector Graphics

Skills Reuse(AJAX)

Page 15: Silverlight Document Search Engine

Silverlight 2

High Performance

Runtime

Flexible Data Access

Rich UI Controls & Deep Zoom

Content Protection

Robust Networking

Role-Based Tools & DLR

Page 16: Silverlight Document Search Engine

Silverlight 3

Out of Browser GPU Acceleration

Navigation & Validation

H.264 / AACPerspective

Transforms & Pixel Shaders

Silverlight Toolkit

Page 17: Silverlight Document Search Engine

Silverlight 4

Elevated Trust Printing Webcam / Mic

Rich Text & HTML Hosting

Input Improvements

Localized to 41 Languages

Page 18: Silverlight Document Search Engine

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

Page 19: Silverlight Document Search Engine

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

Page 20: Silverlight Document Search Engine

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);

Page 21: Silverlight Document Search Engine

Networking Asynchronous HTTP requests

GET/POST Access to most headers, cookies,

Uses browser networking stack Caching, authentication, proxy , compression

Page 22: Silverlight Document Search Engine

Web ServicesSOAP 1.1

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

Asynchronous invocationFollows cross-domain policy restrictionsGenerated proxies support data binding

Page 23: Silverlight Document Search Engine

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);}

Page 24: Silverlight Document Search Engine

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>

Page 25: Silverlight Document Search Engine

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

Page 26: Silverlight Document Search Engine

Designer/Developer Collaboration

Page 27: Silverlight Document Search Engine

Desktop

Media& RIA

Server, Services

Tooling

DesignerLook, behavior, brand,and emotional connection

DeveloperFunction, deployment, data,

security, operational integrity

Server Vista

XAML

Page 28: Silverlight Document Search Engine

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

Page 29: Silverlight Document Search Engine

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

Page 30: Silverlight Document Search Engine

Demo

Page 31: Silverlight Document Search Engine

Q&A

ContactMustaţă [email protected]

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