SlideShare a Scribd company logo
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 index
 Factors Affecting Search:

 Precision – How well the system can filter
 Speed
 Single, 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


                         Quer
                         y

    Doc                               Doc
    s                                 s

          Indexing API
                                Hit
                         Inde   s
                         x
Lucene
 High-performance, full-featured text search engine library
 Written 100% in pure java & C#
 Easy to use yet powerful API
 Jakarta Apache Product. Strong open source community
 support.
Why Lucene?

 Open source (Not proprietary)
 Easy to use, good documentation
 Interoperable - Ex: Index generated by java can
 be used by VB, asp, perl application
 Powerful And Highly Scalable
 Index Format
   Designed for interoperability
   Well Documented
   Resides on File System, RAM, custom store
Indexing With Lucene
What type of documents can be indexed?

   Any document from which text can be fetched and extracted
   over 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
Silverlight
      Overview
        cross-browser
        cross-platform
         cross-device
  Plug-in for building and delivering the
            next generation of
          .NET based

     media experiences
             and
rich interactive applications

            for the   Web
Silverlight is a .NET technology



                   Server            Desktop
                 & Services



                              .NET




                                     Devices,
                  Browser             Mobile




             Silverlight extends your .NET
             Reach.
A Brief History of Silverlight
      MIX 07             Sep 07             MIX 08          Oct 08


Silverlight 1.0      Silverlight 1.0   Silverlight 2   Silverlight 2
Beta                                   Beta
Silverlight 1.1
Alpha

      MIX 09              Jul 09           PDC 09         Spring 10


Silverlight 3 Beta   Silverlight 3     Silverlight 4   Silverlight 4
                                       Beta
Silverlight 1.0




                  Designer /
   X-Browser                    High Quality
                  Developer
   X-Platform                   Audio/Video
                  Workflow

                  Animation &
                                Skills Reuse
  Auto-Updater      Vector
                                  (AJAX)
                   Graphics
Silverlight 2




      High
                Flexible Data   Rich UI Controls
  Performance
                   Access        & Deep Zoom
    Runtime


    Content      Robust          Role-Based
   Protection   Networking       Tools & DLR
Silverlight 3




                     GPU            Navigation &
 Out of Browser
                  Acceleration       Validation


                   Perspective
  H.264 / AAC     Transforms &    Silverlight Toolkit
                  Pixel Shaders
Silverlight 4




 Elevated Trust     Printing     Webcam / Mic



  Rich Text &         Input      Localized to 41
 HTML Hosting     Improvements     Languages
Presentation Core – Graphics
  2D Graphics
     Vector based
     Standard shapes and Paths
     Masking and clipping
     Transformations: skew, rotate, scale, translate, matrix

  Animation Basics
     Time-based
     Support linear, discrete and spline animation
     Animatable property types:
        Double, Color, Point
     Animations and graphics can be defined using XAML or code
Declarative Programming Through XAML
             Extensive Application Markup Language

               Toolable, declarative markup
               Code and content are separate
               Compatible with Windows Presentation Foundation




 XAML                         C#                                    VB.NET
<Button Width="100"> OK      Button b1 = new Button();             Dim b1 As New Button
<Button.Background>          b1.Content = "OK";                    b1.Content = "OK"
LightBlue                    b1.Background = new SolidColorBrush   b1.Background = New _
</Button.Background>         (Colors.LightBlue);                   SolidColorBrush(Colors.LightBlue)
</Button>                    b1.Width = 100;                       b1.Width = 100
Databinding
  Two way data binding from User interface to business
  objects
  Notification via INotifyPropertyChanged
  DataContext is inherited via Visual Tree

  From XAML
     <TextBlock Text="{Binding Nasdaq.Points, Mode=OneWay}"/>
       Binding binding = new Binding("Nasdaq.Points");
  From binding.Mode = BindingMode.OneWay;
        code
       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 Services
 SOAP 1.1
     Basic profile
     A few restrictions (e.g. SOAP Faults not supported)
 Asynchronous invocation
 Follows cross-domain policy restrictions
 Generated 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
                                               <?xml version="1.0"?>
    2 formats:                                 <!DOCTYPE cross-domain-policy SYSTEM
          Flash policy file                    "http://www.macromedia.com/xml/dtds/cross-domain-policy.
                                               dtd">
          Silverlight policy file              <cross-domain-policy>
                                               <allow-access-from domain="*" />
                                               </cross-domain-policy>

                                                                               Cross-domain.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>

                      clientaccesspolicy.xml
Isolated Storage
  Stream based access to a private file/directory structure
  Patterned after .NET Framework IsolatedStorage classes
  Read and write string or binary data
  Store is per application XAP
  Application code to request size increase
          User prompt to accept quota increase
          Quotas fall into predetermined size slots
          Code must initiate increase size call from within user
          input/event
Designer/Developer Collaboration
Tooling
                                     Server Vista



                                                             Desktop
                      Server, Services




                                                XAML




          Designer                                              Developer
          Look, behavior, brand,                         Function, deployment, data,
          and emotional connection                      security, operational integrity

                                                Media
                                                & RIA
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 Together
  Highly productive development framework
     Multi-language support
     Latest developer innovations (e.g. LINQ, Generics)
     AJAX integration
  Great tools
     Visual Studio
     Expression Studio
  Cross-platform & cross-browser plugin
     Works with Safari, Firefox, Google Chrome and Internet Explorer
     Mac OS X and Windows
     Any web server
     Fast, easy install process
  Securely extends your web browser’s sandbox
     Off-line storage, OpenFileDialog, Sockets, cross-domain
Demo
Q&A
 Contact
     Mustaţă Bogdan
     mustata.bogdan@rms.ro

 Links
 http://silverlight.net/
 http://team.silverlight.net/
 http://www.silverlightshow.net/
 MS Expression Studio 3: http://www.microsoft.
 com/expression/products/Studio_Overview.aspx
 Silverlight 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=0
 3 Day Deep Dive into Silverlight: http://www.microsoft.
 com/education/facultyconnection/articles/articledetails.aspx?cid=2023&c1=en-us&c2=0

More Related Content

Silverlight Document Search Engine

  • 1. Silverlight Document search engine Mustaţă Bogdan mustata.bogdan@rms.ro | RomSoft March 2010
  • 2. Agenda 1. Lucene 1. Silverlight overview 1. Demo & Code
  • 3. Intelligent Crawling and Indexing using Lucene
  • 4. Searching Looking up words in an index Factors Affecting Search: Precision – How well the system can filter Speed Single, Multiple Phase queries, Results ranking, Sorting, Wild card queries, Range queries support
  • 5. 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
  • 6. Search Process Quer y Doc Doc s s Indexing API Hit Inde s x
  • 7. Lucene High-performance, full-featured text search engine library Written 100% in pure java & C# Easy to use yet powerful API Jakarta Apache Product. Strong open source community support.
  • 8. Why Lucene? Open source (Not proprietary) Easy to use, good documentation Interoperable - Ex: Index generated by java can be used by VB, asp, perl application Powerful And Highly Scalable Index Format Designed for interoperability Well Documented Resides on File System, RAM, custom store
  • 9. Indexing With Lucene What type of documents can be indexed? Any document from which text can be fetched and extracted over 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/
  • 10. Demo
  • 11. Silverlight Overview cross-browser cross-platform cross-device Plug-in for building and delivering the next generation of .NET based media experiences and rich interactive applications for the Web
  • 12. Silverlight is a .NET technology Server Desktop & Services .NET Devices, Browser Mobile Silverlight extends your .NET Reach.
  • 13. A Brief History of Silverlight MIX 07 Sep 07 MIX 08 Oct 08 Silverlight 1.0 Silverlight 1.0 Silverlight 2 Silverlight 2 Beta Beta Silverlight 1.1 Alpha MIX 09 Jul 09 PDC 09 Spring 10 Silverlight 3 Beta Silverlight 3 Silverlight 4 Silverlight 4 Beta
  • 14. Silverlight 1.0 Designer / X-Browser High Quality Developer X-Platform Audio/Video Workflow Animation & Skills Reuse Auto-Updater Vector (AJAX) Graphics
  • 15. Silverlight 2 High Flexible Data Rich UI Controls Performance Access & Deep Zoom Runtime Content Robust Role-Based Protection Networking Tools & DLR
  • 16. Silverlight 3 GPU Navigation & Out of Browser Acceleration Validation Perspective H.264 / AAC Transforms & Silverlight Toolkit Pixel Shaders
  • 17. Silverlight 4 Elevated Trust Printing Webcam / Mic Rich Text & Input Localized to 41 HTML Hosting Improvements Languages
  • 18. Presentation Core – Graphics 2D Graphics Vector based Standard shapes and Paths Masking and clipping Transformations: skew, rotate, scale, translate, matrix Animation Basics Time-based Support linear, discrete and spline animation Animatable property types: Double, Color, Point Animations and graphics can be defined using XAML or code
  • 19. Declarative Programming Through XAML Extensive Application Markup Language Toolable, declarative markup Code and content are separate Compatible with Windows Presentation Foundation XAML C# VB.NET <Button Width="100"> OK Button b1 = new Button(); Dim b1 As New Button <Button.Background> b1.Content = "OK"; b1.Content = "OK" LightBlue b1.Background = new SolidColorBrush b1.Background = New _ </Button.Background> (Colors.LightBlue); SolidColorBrush(Colors.LightBlue) </Button> b1.Width = 100; b1.Width = 100
  • 20. Databinding Two way data binding from User interface to business objects Notification via INotifyPropertyChanged DataContext is inherited via Visual Tree From XAML <TextBlock Text="{Binding Nasdaq.Points, Mode=OneWay}"/> Binding binding = new Binding("Nasdaq.Points"); From binding.Mode = BindingMode.OneWay; code TextBlock tb = new TextBlock(); tb.SetBinding(TextBlock.TextProperty, binding);
  • 21. Networking Asynchronous HTTP requests GET/POST Access to most headers, cookies, Uses browser networking stack Caching, authentication, proxy , compression
  • 22. Web Services SOAP 1.1 Basic profile A few restrictions (e.g. SOAP Faults not supported) Asynchronous invocation Follows cross-domain policy restrictions Generated proxies support data binding
  • 23. 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); }
  • 24. Cross-domain support <?xml version="1.0"?> 2 formats: <!DOCTYPE cross-domain-policy SYSTEM Flash policy file "http://www.macromedia.com/xml/dtds/cross-domain-policy. dtd"> Silverlight policy file <cross-domain-policy> <allow-access-from domain="*" /> </cross-domain-policy> Cross-domain.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> clientaccesspolicy.xml
  • 25. Isolated Storage Stream based access to a private file/directory structure Patterned after .NET Framework IsolatedStorage classes Read and write string or binary data Store is per application XAP Application code to request size increase User prompt to accept quota increase Quotas fall into predetermined size slots Code must initiate increase size call from within user input/event
  • 27. Tooling Server Vista Desktop Server, Services XAML Designer Developer Look, behavior, brand, Function, deployment, data, and emotional connection security, operational integrity Media & RIA
  • 28. 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
  • 29. Silverlight and .NET: Better Together Highly productive development framework Multi-language support Latest developer innovations (e.g. LINQ, Generics) AJAX integration Great tools Visual Studio Expression Studio Cross-platform & cross-browser plugin Works with Safari, Firefox, Google Chrome and Internet Explorer Mac OS X and Windows Any web server Fast, easy install process Securely extends your web browser’s sandbox Off-line storage, OpenFileDialog, Sockets, cross-domain
  • 30. Demo
  • 31. Q&A Contact Mustaţă Bogdan mustata.bogdan@rms.ro Links http://silverlight.net/ http://team.silverlight.net/ http://www.silverlightshow.net/ MS Expression Studio 3: http://www.microsoft. com/expression/products/Studio_Overview.aspx Silverlight 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=0 3 Day Deep Dive into Silverlight: http://www.microsoft. com/education/facultyconnection/articles/articledetails.aspx?cid=2023&c1=en-us&c2=0