Advanced Searching on help.unc.edu


 Introduction

The search engine for help.unc.edu is powered by [ http://lucene.apache.org/ ] Apache Lucene . While a simple keyword search is often enough to locate the right document, sometimes a slightly more complex query is required. Lucene provides a number of advanced query features beyond the simple keyword search. This document will highlight the basics of using the advanced query syntax.

Note

In May 2006, the search engine for help.unc.edu was replaced. The old advanced search page, no longer being relevant, has been removed. Advanced searches can now be performed in the basic search box by using the advanced query syntax covered in this document.

 The Basics

 Terms and Phrases

Lucene defines a term as a single word. Entering multiple terms in the search box will retrieve documents which contain at least one of the terms. For example, oracle calendar will search for documents with either oracle or calendar . A phrase , however, consists of multiple terms surrounded by quotes. For a document to match, it must contain the phrase, exactly as entered in the search box. So, in contrast to the previous example, "oracle calendar" (note the quotation marks) will only return those documents which contain the phrase oracle calendar .

 Fields

Unless otherwise specified, terms and phrases are searched for throughout the entire document. Lucene supports field specific searches if you need to narrow your search down to a specific part of the document, such as the document's title. To search for a term or phrase in a specific field, enter the field name, a colon and your search term or phrase. For example, title:"windows xp" will only match documents with the phrase windows xp appearing in the title. The following fields are available for searching on help.unc.edu:

 

Table 1. Available Search Fields on help.unc.edu

Field Name Content Searched
author You can use this search to find all documents owned by a specific person. Try using a search phrase, i.e. put quotes around the name: author:"Charles Lee"
author-uid Search for documents owned by the designated Onyen.
content This will search only the text of the document, not the title or keywords.
genre The genre of the document.
group Search for documents owned by a specific documentation group, e.g. group:"Knowledge Management"
id Search for a specific document id.
link-to Each document on help.unc.edu has a Document ID, which can be found near the bottom of the document. link-to will return a list of documents linking to the specified document. For example , link-to:5765 will find all documents which link to this document (#5765).
subject The specific subjects attached to a document.
tag The specific tags attached to a document.
title This will search only the words appearing in the title of the document.

 Boolean Operators

Lucene recognizes the Boolean operators AND , OR and NOT . Please note, Boolean operators must be capitalized in order to be recognized as Boolean operators.

Tip

Note the difference between the following three queries, listed in order of increasing specificity:

  • computer labs

  • computer AND labs

  • "computer labs"

 Wildcards

The wildcard characters * and ? are also available for use in Lucene. The * wildcard matches multiple characters and the ? wildcard matches a single character. For example, network* would match network , networks or networking , whereas the search term network? would only match networks. (Why doesn't network? match network , you might ask? The ? wildcard matches only one character, not zero characters. Perhaps a more useful application of the ? wildcard is for capturing variant spellings, e.g. gr?y .) Wildcard characters can be placed in the middle of words, too, but you cannot put a wildcard character at the beginning of a word.

 Grouping

Parenthesis can be used to group multiple search terms into logical groups. They are often a good idea if you are combining multiple terms with different Boolean operators, as the results will be easier to predict. For example, the search photoshop AND (tutorial OR howto) will return documents containing the word photoshop and either tutorial or howto .

 Example Searches

blackboard AND grades would match documents containing both the words blackboard and grades anywhere in the document.

chang* AND onyen AND password would match documents containing onyen , password and any one of the variants of change , such as change , changes or changing .

(title:"oracle calendar" AND title:client*) AND (mac* OR linux) might be useful for finding Mac or Linux documentation on Oracle Calendar clients.

 More Information

While this document covers most of the advanced search features you might want to use, there are a few more search options available which are documented on the [ http://help.unc.edu/?id= ] [ http://lucene.apache.org/java/docs/queryparsersyntax.html ] Apache Lucene site .

Copyright 2002-2007 The University of North Carolina at Chapel Hill.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 United States License.

Post a Comment

This form is for document feedback. If you need technical assistance, and are affiliated with UNC-Chapel Hill, please Submit a Help Request
Optional
Optional
So that we may contact you.
Do not fill out this form, this is a spam trap.
Top
University of North Carolina - Chapel Hill