The article describes how to use knowledge base search engine to utilize the underlying Lucene.NET engine.
Categories: Knowledge Base
|
Revision:
1
Posted:
22/Dec/2010
Updated:
30/Dec/2010
Status:
Publish
Types: Article
|
Indexing and searchingAt the heart of all search engines is the concept of indexing: processing the original data into a highly efficient cross-reference lookup in order to facilitate rapid searching. Searching is the process of looking up words in an index to find documents where they appear. User of Lucene powered application can make searches such as: George Rice -eat -pudding, Apple –pie Tiger, animal:monkey AND food:banana What Lucene.NET isLucene is a high performance, scalable Information Retrieval (IR) library. It lets you add indexing and searching capabilities to your applications. Lucene is a mature, free, open-source project ported from Java to .NET platform; it’s a member of the popular Apache Jakarta family of projects, licensed under the Apache Software License. As such, Lucene is currently, and has been for a few years, the most popular free Java IR library. Document and FieldsThe source of information for indexing could be a text file, binary file like Word document or ever a record in a database. The only requirement to know how to parse these source documents in a sequence of strings or numbers. During the Indexing process each source document explored and valuable pieces of information extracted and organized. Lucene index contains multiple Documents corresponding to source documents. Each Lucene Document contains fields - distingushable text content place holders. Once the Lucene Document created and submitted to the index, we can make a search with query. Query syntaxFull manual describing in details the query syntax available in the HTML and PDF formats on the official site. Let's discuss the part of it to ensure we understand the basic. A query is broken up into terms and operators. There are two types of terms: Single Terms and Phrases. A Single Term is a single word such as "control" or "checkbox". A Phrase is a group of words surrounded by double quotes such as "hello dolly". Multiple terms can be combined together with Boolean operators to form a more complex query.
Lucene supports fielded data. When performing a search you can either specify a field, or use the default field. As an example, let's assume a Lucene index contains two fields, title and text and text is the default field. If you want to find the document entitled "The Right Way" which contains the text "don't go this way", you can enter:
title:"The Right Way" AND text:go
title:"Do it right" AND right
Since text is the default field, the field indicator is not required. Wildcard searches To perform a single character wildcard search use the "?" symbol. To perform a multiple character wildcard search use the "*" symbol. Boolean operators Boolean operators allow terms to be combined through logic operators. Lucene supports AND, "+", OR, NOT and "-" as Boolean operators (Note: Boolean operators must be ALL CAPS).
The AND operator matches documents where both terms exist anywhere in the text of a single document. The OR operator (default conjunction) links two terms and finds a matching document if either of the terms exist in a document. The "+" or required operator requires that the term after the "+" symbol exist somewhere in a the field of a single document. The NOT operator excludes documents that contain the term after NOT. The symbol ! can be used in place of the word NOT. The "-" or prohibit operator excludes documents that contain the term after the "-" symbol. Index Fields available for search in the Knowledge base articlesThe source documents in the Knowledge Base are the articles. The fields available in queries are listed below:
- title - the article's title
- description - short description of article content
- content - [Default field] - content of description articles and summary of all other fields
- createdby / updatedby - article author / updater display name
- createdon / updatedon - articles creation / update DateTime in format YYYYMMDD or YYYYMMDDHHSS
- type - article type, for example: walkthrough, video
- featured - True/False indicating where the article is marked as featured
- hastemplate - True/False indicating where the article contains templates
- hascode - True/False indicating where the article has "code" content elements
- hasdownload - True/False indicating where the article has download elements
- template - summary field with article template names, to query for articles with specific template
- code - summary field of all article code elements
- download - summary field of all article download elements
- wiki - True/False indicating where the article originated from Visual WebGui Wiki
Examples1. Query: appletbox checkbox To search for articles that related to either "appletbox" or "checkbox". Two terms with OR conjunction. Default field content is been searched. 2. Query: ScheduleBox AND Format To search for articles that contain both words "ScheduleBox" and "Format". 3. Query: description:datagridview AND cell To search for articles that description (a field) contains the word "datagridview" and the word "cell" appears in content elsewhere. 4. Query: description:datagridview AND NOT(cell) To search for articles that description (a field) contains the word "datagridview" and the word "cell" does not appear in content. 5. Query: keyword:(format* date*) Wildcard search for keyword field for words starting from "format" or "date". See Field grouping section in the manual referenced above. 6. Query: createdon:[20100101 TO 20100701] To search for articles created (datetime field) between 01 Jan 2010 and 01 July 2010. See section 4.4 Range Searches in the manual referenced above.
About the author
Related Articles
|
Knowledge Base
|
|
|
In this How to we are going to learn the basic usage of Visual WebGui RIA Platform Theme & Control designer.
Tags:
Developers, Graphic Designers, Theme, 1. Beginner, 2. Intermediate, Customization, v6.4 and Later, 3. Advanced
|
|
|
Visual WebGui architecture provides an optimized monitoring and configuring capabilities. Based on this, Visual WebGui will provide a set of management tools, for pre-deployment calculation of the various cloud providers running costs, application monitoring, bottle neck detecting, application confi...
Tags:
Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, ASP.NET, Cloud, v6.3, v6.4 and Later
|
|
|
Visual WebGui is a comprehensive Cloud application development solution providing exceptional development, runtime, management and deployment benefits.
Tags:
Architects, Developers, 1. Beginner, 2. Intermediate, 3. Advanced, ASP.NET, Cloud, v6.3, v6.4 and Later
|
|
|
Learn how to customize the look & feel of controls in a Visual WebGui Ajax Web or Cloud application using a cutting-edge theme designer that will easily provide the UI with a desired design.
Tags:
Architects, Developers, Graphic Designers, Theme, 1. Beginner, 2. Intermediate, 3. Advanced, Customization, v6.4 and Later
|
|
|
Tags:
Developers, Graphic Designers, Theme, 1. Beginner, 2. Intermediate, Customization, v6.4 and Later, 3. Advanced
|
|
|
In this how to we are going to learn how to create a Visual WebGui custom control with the use of the new visual Control & Theme Designer introduced in version 6.4.
Tags:
Developers, Graphic Designers, Theme, 1. Beginner, 2. Intermediate, Customization, v6.4 and Later, 3. Advanced
|
|
|
|