This site is for demonstration purposes and has been scrubbed for proprietary data. Return to dmbaughman.com

Developer Help

Search Forms

General Usage

The following search forms can be used to add a search box to a website. The basic option will search the entire enterprise index, while the other forms allow you to specify a specific site or type of document to return.

Branding Guidelines

These examples only illustrate the search functionality of the search box. For details on how to style your search box, visit the Intranet Style Guide for details on styling and placement.

Basic Search

The following example will search the entire enterprise index.

<form name="BoeingSearch" method="GET" action="http://search.boeing.com/pages/results.aspx" />
    <input type="text" name="k" size="40" maxlength="256" value="" />
    <input type="hidden" name="source" value="ngs" />
    <input type="submit" name="btnG" value="Search" />
</form>

Search a Website

This example will limit the search to a specific website.

<form name=" BoeingSearch" method="GET" action="http://search.boeing.com/pages/results.aspx">
    <input type="text" name="k" size="40" maxlength="256" value="" />
    <input type="hidden" name="source" value="ngs" />
    <input type="hidden" name="u" value="http://yoursite.web.boeing.com" />
    <input type="submit" name="btnG" value="Search" />
</form>

Pro Tip: Be sure to replace yoursite.web.boeing.com with the actual URL for your site.


Search a File Share

This example will limit the search to a specific file share.

<form name=" BoeingSearch" method="GET" action="http://search.boeing.com/pages/results.aspx">
    <input type="text" name="k" size="40" maxlength="256" value="" />
    <input type="hidden" name="source" value="ngs" />
    <input type="hidden" name="u" value="file://yourfolder/subfolder/" />
    <input type="submit" name="btnG" value="Search" />
</form>

Search a File Share for Specific File Types

This example will a specific file share for only PDF and XLS documents. Other file types can be used following the same pattern.

<form name=" BoeingSearch" method="GET" action="http://search.boeing.com/pages/results.aspx">
    <input type="text" name="k" size="40" maxlength="256" value="" />
    <input type="hidden" name="source" value="ngs" />
    <input type="hidden" name="u" value="file://yourfolder/subfolder/" />
    <input type="checkbox" name="a" value="fileextension:pdf fileextension:xls" />
    <label for="a">  PDF and XLS Types only</label>
    <input type="submit" name="btnG" value="Search" />
</form>

Advanced Forms

File Share with File Type Filters

This example will a specific file share for only PDF and XLS documents. Other file types can be used following the same pattern.

<form name=" BoeingSearch" method="GET" action="http://search.boeing.com/pages/results.aspx">
    <input type="text" name="k" size="40" maxlength="256" value="" />
    <input type="hidden" name="source" value="ngs" />
    <input type="hidden" name="u" value="file://yourfolder/subfolder/" />
    <input type="checkbox" name="a" value="fileextension:pdf fileextension:xls" />
    <label for="a">  PDF and XLS Types only</label>
    <input type="submit" name="btnG" value="Search" />
</form>

Advanced Form with Property Filters

This example uses JavaScript to build queries with property filters (e.g. author, title, description).

<!DOCTYPE html>
<html>
<head>
    <title>JavaScript Codes to access Next-Gen Search</title>
    <meta name="robots" content="index,follow" />
    <meta name="keywords" content="NextGen Search, Next Generation Search, Boeing Enterprise Search, Javascript Form sample" />
    <meta name="web" content="1" />
    <meta name="author" content="John P Le - 1630046 - john.p.le@boeing.com" />

    <!--  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
          JavaScript is case-sensitive.  
          NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE  -->

    <script type="text/javascript">
        function ComposeURL(which) {
            //Constant values
            var CONSTANT_SPACE = "%20";
            var CONSTANT_QUOTE = "%22";

            var CONSTANT_SITE_TARGET = "http://search.boeing.com/Pages/results.aspx?source=ngs&k=";

            //capture all values from the form
            var allWords = trim(document.getElementById("txtAll").value);

            //keywords manipulation
            if (allWords != "") {
                allWords = "ALL(" + allWords + ")";
                allWords = allWords.replace(" ", CONSTANT_SPACE);
            }


            //Managed Property filter
            var propertyValue = trim(document.getElementById("txtProperty").value);
            if (propertyValue != "") {
                var ddlProperty = document.getElementById("ddlproperty").value;
                var propertyQuery = "";
                switch (ddlProperty) {
                    case "Author":
                        propertyQuery = " AUTHOR:" + CONSTANT_QUOTE + propertyValue + CONSTANT_QUOTE;
                        break;
                    case "Title":
                        propertyQuery = " TITLE:" + CONSTANT_QUOTE + propertyValue + CONSTANT_QUOTE;
                        break;
                    case "Description":
                        propertyQuery = " DESCRIPTION:" + CONSTANT_QUOTE + propertyValue + CONSTANT_QUOTE;
                        break;
                    case "URLPath":
                        propertyQuery = " PATH:" + CONSTANT_QUOTE + propertyValue + CONSTANT_QUOTE;
                        break;
                    case "FileName":
                        propertyQuery = " FILENAME:" + CONSTANT_QUOTE + propertyValue + CONSTANT_QUOTE;
                        break;
                }
            }

            var url = CONSTANT_SITE_TARGET + allWords + propertyQuery;

            window.open(url);           // Open new window
            //window.location.href = url;      // Use existing window
        }

        function trim(str) {
            return str.replace(/^\s*([\S\s]*)\b\s*$/, '$1');
        }

    </script>
</head>
<body>
    <form id="form1" method="get">
    <div>
        <h1>
            NextGen Search Sample Form</h1>
        <table border="0" width="400">
            <tr>
                <td align="right">
                    All of these words
                </td>
                <td>
                    <input name="txtAll" id="txtAll" type="text" value="boeing ets" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <fieldset style="width: 300px">
                        <legend>Search Scope</legend>
                        <select name="ddlproperty" id="ddlproperty">
                            <option value="Author" selected="selected">Author</option>
                            <option value="Title">Title</option>
                            <option value="Description">Description</option>
                            <option value="URLPath">URL or Path</option>
                            <option value="FileName">File Name</option>
                        </select>
                        Value:  <input name="txtproperty" id="txtproperty" type="text" />
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="button" name="Submit" value="Search Now" onclick="ComposeURL(this);" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>


Caution: Be careful when customizing this example. The IDs used in the HTML must match the JavaScript references exactly.


Super Advanced Search Box

This example uses JavaScript to build complex, advanced queries.

             
<!DOCTYPE html>
<html>
<head>
    <title>JavaScript Codes to access Next-Gen Search</title>
    <meta name="robots" content="index,follow" />
    <meta name="keywords" content="NextGen Search, Next Generation Search, Boeing Enterprise Search, Javascript Form sample" />
    <meta name="web" content="1" />
    <meta name="author" content="John P Le - 1630046 - john.p.le@boeing.com" />

    <!--  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
          JavaScript is case-sensitive.  
          NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE  -->

    <script type="text/javascript">
        function ComposeURL(which) {
            //Constant values
            var CONSTANT_SPACE = "%20";
            var CONSTANT_QUOTE = "%22";

            var CONSTANT_SORT_NEWEST = "&v1=%2Dwrite";
            var CONSTANT_SORT_OLDEST = "&v1=%2Bwrite";
            var CONSTANT_SORT_RELEVANCE = "&v1=default";

            var CONSTANT_EXT_DOCX = "(FileExtension=\"doc\" OR FileExtension=\"docx\" OR FileExtension=\"dot\" OR FileExtension=\"docm\" OR FileExtension=\"odt\")";
            var CONSTANT_EXT_XLSX = "(FileExtension=\"xls\" OR FileExtension=\"xlsx\" OR FileExtension=\"xlsm\" OR FileExtension=\"xlsb\" OR FileExtension=\"ods\")";
            var CONSTANT_EXT_PPTX = "(FileExtension=\"ppt\" OR FileExtension=\"pptx\" OR FileExtension=\"pptm\" OR FileExtension=\"odp\")";

            var CONSTANT_SITE_TARGET = "http://ngsprod.web.boeing.com/Pages/results.aspx?source=ngs&k=";

            //capture all values from the form
            var allWords = trim(document.getElementById("txtAll").value);
            var anyWords = trim(document.getElementById("txtAny").value);
            var exactWords = trim(document.getElementById("txtExact").value);
            var noneWords = trim(document.getElementById("txtNone").value);

            //keywords manipulation
            if (allWords != "") {
                allWords = "ALL(" + allWords + ")";
                allWords = allWords.replace(" ", CONSTANT_SPACE);
            }

            if (anyWords != "") {
                anyWords = "ANY(" + anyWords + ")";
                anyWords = anyWords.replace(" ", CONSTANT_SPACE);
            }

            if (exactWords != "") {
                exactWords = CONSTANT_QUOTE + exactWords + CONSTANT_QUOTE;
                exactWords = exactWords.replace(" ", CONSTANT_SPACE);
            }

            if (noneWords != "") {
                noneWords = "NONE(" + noneWords + ")";
                noneWords = noneWords.replace(" ", CONSTANT_SPACE);
            }

            //Document Type
            var ddlType = document.getElementById("ddlType").value;
            var doctypequery = "";
            switch (ddlType) {
                case "docx":
                    doctypequery = CONSTANT_EXT_DOCX;
                    break;
                case "xlsx":
                    doctypequery = CONSTANT_EXT_XLSX;
                    break;
                case "pptx":
                    doctypequery = CONSTANT_EXT_PPTX;
                    break;
            }
            if (doctypequery) {
                doctypequery = doctypequery.replace("\"", CONSTANT_QUOTE);
                doctypequery = doctypequery.replace(" ", CONSTANT_SPACE);
            }

            //Search scope:  Radio buttons
            //            var searchScope = getRadioValue("options");
            //            if (searchScope) {
            //                var searchScope = CONSTANT_SPACE + "PATH:" + CONSTANT_QUOTE + searchScope + CONSTANT_QUOTE;
            //                searchScope = searchScope.replace("\"", CONSTANT_QUOTE);
            //            }


            //Another way to narrow down the scope by using multiple selections:  Checkboxes.
            var searchScope = "";
            var MultiSearchScope = new Array();
            MultiSearchScope = getCheckboxValues("MultiOptions");
            for (var ind = 0; ind < MultiSearchScope.length; ind++) {
                searchScope = searchScope + CONSTANT_SPACE + "PATH:" + CONSTANT_QUOTE + MultiSearchScope[ind] + CONSTANT_QUOTE + " OR";
            }
            //Get rid of the last "OR" boolean in the string.
            searchScope = searchScope.substring(0, searchScope.length - 3);

            //Sort By
            var sortby = document.getElementById("ddlSortBy").value;
            var sortbyquery = "";
            switch (sortby) {
                case "Newest":
                    sortbyquery = CONSTANT_SORT_NEWEST;
                    break;
                case "Oldest":
                    sortbyquery = CONSTANT_SORT_OLDEST;
                    break;
            }

            var url = CONSTANT_SITE_TARGET + allWords + exactWords + noneWords + searchScope + doctypequery + sortbyquery;

            window.open(url);           // Open new window
            window.location.href = url;      // Use existing window
        }

        function getRadioValue(radioName) {
            var rads = document.getElementsByName(radioName);
            for (var rad = 0; rad <= rads.length - 1; rad++) {
                if (rads[rad].checked) {
                    return rads[rad].value;
                }
            }
        }

        function getCheckboxValues(checkboxName) {
            var c_value = new Array();
            var arrayindex = 0;
            var chx = document.getElementsByName(checkboxName);
            for (var i = 0; i < chx.length; i++) {
                if (chx[i].checked) {
                    c_value[arrayindex] = chx[i].value;
                    arrayindex++;
                }
            }
            return c_value;
        }

        function trim(str) {
            return str.replace(/^\s*([\S\s]*)\b\s*$/, '$1');
        }

    </script>
</head>
<body>
    <form id="form1" method="get">
    <div>
        <h1>
            NextGen Search Sample Form</h1>
        <table border="0" width="400">
            <tr>
                <td align="right">
                    All of these words
                </td>
                <td>
                    <input name="txtAll" id="txtAll" type="text" value="boeing ets" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    Any of these words
                </td>
                <td>
                    <input name="txtAny" id="txtAny" type="text" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    The exact phrase
                </td>
                <td>
                    <input name="txtExact" id="txtExact" type="text" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    None of these words
                </td>
                <td>
                    <input name="txtNone" id="txtNone" type="text" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    Result Type
                </td>
                <td>
                    <select name="ddlType" id="ddlType">
                        <option value="" selected="selected">All Results</option>
                        <option value="docx">Word Documents</option>
                        <option value="xlsx">Excel Documents</option>
                        <option value="pptx">Powerpoint Documents</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <fieldset style="width: 300px">
                        <legend>Search Scope (RadioButton style)</legend>
                        <input type="radio" name="options" checked="checked" value="" />Search All Web<br />
                        <input type="radio" name="options" value="http://inside.boeing.com" />Search inside.boeing.com<br />
                        <input type="radio" name="options" value="http://boeingnews.web.boeing.com" />Search
                        boeingnews.web.boeing.com<br />
                        <input type="radio" name="options" value="\\nw\data\737MCIT" />Search \\nw\data\737MCIT\<br />
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <fieldset style="width: 300px">
                        <legend>Search Scope (Checkbox style)</legend>
                        <input type="checkbox" name="MultiOptions" value="\\nw\data\737MCIT" />Search inside
                        \\nw\data\737MCIT\
                        <br />
                        <input type="checkbox" name="MultiOptions" value="\\nw\data\PRASD" />Search inside
                        \\nw\data\PRASD\<br />
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <fieldset style="width: 300px">
                        <legend>Sort By</legend>
                        <select name="ddlSortBy" id="ddlSortBy">
                            <option value="Relevance" selected="selected">Relevance</option>
                            <option value="Newest">Date (Newest)</option>
                            <option value="Oldest">Date (Oldest)</option>
                        </select>
                    </fieldset>
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center">
                    <input type="button" name="Submit" value="Search Now" onclick="ComposeURL(this);" />
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>


Download Example: Download the demo page for this example here.

Caution: Be careful when customizing this example. The IDs used in the HTML must match the JavaScript references exactly.

Query Syntax

Pro Tip: If you are new to complex queries, use our advanced search page to get started.

Boolean Operators

Boolean operators can be very useful for quickly narrowing down what you want to search for. You can use them to include, exclude, or partially match sets of keywords.


Operator Description Query Syntax URL Query String
All Returns items that match ALL keywords ALL(boeing) results.aspx?k=ALL(boeing)
OR Returns items that match AT LEAST ONE of the keywords OR(boeing 737) results.aspx?k=OR(boeing%20737)
ANY Similar to OR, except that the dynamic rank is affected by neither the number of operands that match nor the distance between the keywords in the item ANY(boeing ets) results.aspx?k=ANY(boeing%20ets)
NONE Returns only items that do not match the keywords. This NONE operator must be used along with other operators (ALL, ANY...) ALL(boeing 737) NONE(ets 787 777) results.aspx?k=ALL(boeing%20737)%20NONE(ets%20787%20777)

Property Restrictions

Property restrictions allow you to search specifically by the metadata of a document. This can be handy if you want to find all the documents you've creaated, or if you want to find the old documents on your site that need to be cleaned up.


Property Description Query Syntax URL Query String
Author Searches by author of the document ALL(boeing signature) Author=dlh4552 results.aspx?k=ALL(boeing%20signature)%20Author%3Ddlh4552
Description Searches within the description of the document Description:"enterprise search" results.aspx?k=Description%3A"enterprise search"
Name Searches for keywords in the document FileName:"developer help" results.aspx?k=FileName%3A"developer help"
Size Searches by the size of the document Size>2097152 results.aspx?k=Size>2097152
URL (Path) Searches for pages within a specific site or file path Path="search.boeing.com" results.aspx?k=Path%3A"search.boeing.com"
Last Modified Date Searches for documents by date (MS Office Documents Only) Write>=6/1/12 results.aspx?k=Write>%3D6%2F1%2F12
Last Modified By Searches by the person or account that last changed the file (MS Office Documents Only) ModifiedBy:michael johnson results.aspx?k=ModifiedBy%3Amichael%20johnson

Remove Content

Remove a Website

We encourage site adminsitrators to use robots exclusion directives at the root of their sites to instruct our crawler which directories it is allowed to enter. If you don't want your site crawled at all, just deny access to the site root.

Additionally, robots meta tags can be used to give the crawler instructions on a specific page. For example, you can tell the crawler to follow all the links on a page, but not index that page itself.

For more details on Robots Exclusion methods, check out Wikipedia for lots of examples, and the W3C specification for the authoritative source.

Remove a File Share or SharePoint Site

The best way to remove a file share from our search engine is to revoke access to our crawl account, nw\svcsearch. On a file share, this is done by a share administrator in the file folder's security settings. In SharePoint, site administrators can do this using the "Site Permissions" menu.

In most cases, the crawl account is granted access at a higher level than the file share, so be sure to remove inherited permissions.

Search Optimization

General Recommendations

Some simple principles will help improve the relevance of your content in our search engine.

  • Titles are King: A good, concise title is probably the best thing you can have on a document
  • Clean Metadata: Besure that your metadata is correctly populated. See Content Tips below for more details.
  • Short URLs: yoursite.com vs. yoursite.com/this/is/too/long.html
  • Current Content: The more up-to-date your site content is, the better.
  • Use Flash, iframes, AJAX With Caution: These cause problems for search engines, because they cannot be navigated or interpreted by the crawler. Be sure your main content is formatted as valid HTML.

Relevance Ranking

There are many factors which contribute to the complex relevance ranking algorithms, but here are some of the keys to improving a document's relevance:

  • Click-Throughs: Users search for a term, then click on the search result
  • Link-Backs: Other sites link to the document (must also be in search index)
  • Keyword Occurence: Search term is found repeatedly in the document
  • Site Maturity: Site has been in the index for a long time (related to click-throughs)

Content Tips

Include Metadata

Web Pages

Metadata is a very important part of search engine optimization. You can use meta tags to identify the page's date, author, description, keywords, and many other things. These document attributes are used to build the search refiners, and their absence makes it impossible for refiners to work correctly for your documents. The Intranet Style Guide provides details on what metadata is required for web pages.

Office Documents

Correct document properties are important for other document types as well, such as Word, Excel and PowerPoint. Instructions for how to update document properties (metadata) are available for Office 2007 and Office 2010.

Use Less Words

User research shows that users typically scan--not read--your web pages. If you use less words to convey your message, you increase the chance that your users will read it, while at the same time improving search engine optimization for your content.

Use Meaningful Titles

The title of a document becomes the title of its search result. As much as possible, try to use titles which are meaningful to users--this will help them quickly recognize which document they are looking for.

In the case where it is required to use document IDs for the title, be sure to have a user-friendly description. See the section on metadata for more details.

Still have a question? Check out our help pages on the right side of the footer, or contact us for a quick response.