tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject svn commit: r1628871 [1/5] - in /tajo/site/docs/current: ./ _sources/configuration/ _sources/getting_started/ _sources/sql_language/ _static/ backup_and_restore/ configuration/ functions/ getting_started/ partitioning/ sql_language/ table_management/
Date Thu, 02 Oct 2014 00:36:31 GMT
Author: hyunsik
Date: Thu Oct  2 00:36:30 2014
New Revision: 1628871

URL: http://svn.apache.org/r1628871
Log:
Update doc by TAJO-1068.

Added:
    tajo/site/docs/current/_sources/configuration/ha_configuration.txt
Modified:
    tajo/site/docs/current/_sources/getting_started/building.txt
    tajo/site/docs/current/_sources/sql_language/data_model.txt
    tajo/site/docs/current/_sources/sql_language/queries.txt
    tajo/site/docs/current/_static/basic.css
    tajo/site/docs/current/_static/doctools.js
    tajo/site/docs/current/_static/jquery.js
    tajo/site/docs/current/_static/searchtools.js
    tajo/site/docs/current/_static/underscore.js
    tajo/site/docs/current/_static/websupport.js
    tajo/site/docs/current/backup_and_restore.html
    tajo/site/docs/current/backup_and_restore/catalog.html
    tajo/site/docs/current/cli.html
    tajo/site/docs/current/configuration.html
    tajo/site/docs/current/configuration/catalog_configuration.html
    tajo/site/docs/current/configuration/cluster_setup.html
    tajo/site/docs/current/configuration/configuration_defaults.html
    tajo/site/docs/current/configuration/ha_configuration.html
    tajo/site/docs/current/configuration/preliminary.html
    tajo/site/docs/current/configuration/tajo_master_configuration.html
    tajo/site/docs/current/configuration/worker_configuration.html
    tajo/site/docs/current/faq.html
    tajo/site/docs/current/functions.html
    tajo/site/docs/current/functions/datetime_func_and_operators.html
    tajo/site/docs/current/functions/math_func_and_operators.html
    tajo/site/docs/current/functions/network_func_and_operators.html
    tajo/site/docs/current/functions/string_func_and_operators.html
    tajo/site/docs/current/genindex.html
    tajo/site/docs/current/getting_started.html
    tajo/site/docs/current/getting_started/building.html
    tajo/site/docs/current/getting_started/downloading_source.html
    tajo/site/docs/current/getting_started/first_query.html
    tajo/site/docs/current/getting_started/local_setup.html
    tajo/site/docs/current/getting_started/prerequisites.html
    tajo/site/docs/current/hcatalog_integration.html
    tajo/site/docs/current/index.html
    tajo/site/docs/current/introduction.html
    tajo/site/docs/current/jdbc_driver.html
    tajo/site/docs/current/objects.inv
    tajo/site/docs/current/partitioning/column_partitioning.html
    tajo/site/docs/current/partitioning/hash_partitioning.html
    tajo/site/docs/current/partitioning/intro_to_partitioning.html
    tajo/site/docs/current/partitioning/range_partitioning.html
    tajo/site/docs/current/search.html
    tajo/site/docs/current/searchindex.js
    tajo/site/docs/current/sql_language.html
    tajo/site/docs/current/sql_language/data_model.html
    tajo/site/docs/current/sql_language/ddl.html
    tajo/site/docs/current/sql_language/insert.html
    tajo/site/docs/current/sql_language/predicates.html
    tajo/site/docs/current/sql_language/queries.html
    tajo/site/docs/current/sql_language/sql_expression.html
    tajo/site/docs/current/table_management.html
    tajo/site/docs/current/table_management/compression.html
    tajo/site/docs/current/table_management/csv.html
    tajo/site/docs/current/table_management/file_formats.html
    tajo/site/docs/current/table_management/parquet.html
    tajo/site/docs/current/table_management/rcfile.html
    tajo/site/docs/current/table_management/sequencefile.html
    tajo/site/docs/current/table_partitioning.html
    tajo/site/docs/current/tajo_client_api.html

Added: tajo/site/docs/current/_sources/configuration/ha_configuration.txt
URL: http://svn.apache.org/viewvc/tajo/site/docs/current/_sources/configuration/ha_configuration.txt?rev=1628871&view=auto
==============================================================================
--- tajo/site/docs/current/_sources/configuration/ha_configuration.txt (added)
+++ tajo/site/docs/current/_sources/configuration/ha_configuration.txt Thu Oct  2 00:36:30
2014
@@ -0,0 +1,135 @@
+*********************************
+High Availability for TajoMaster
+*********************************
+
+TajoMaster is a Single Point of Failure in a Tajo Cluster because TajoMaster is the central
controlling entity for all components of the Tajo system. TajoMaster failure prevents clients
from submitting new queries to the cluster, and results in the disruption of the ability to
run insert overwrite queries because the TajoWorker can’t apply its statistical information
to CatalogStore. Therefore, the high-availability (HA) of TajoMaster is essential for the
high-availability of Tajo generally.
+
+Currently, TajoMaster HA provides the following elements:
+
+* Automatic failover of TajoMaster: Even if the active TajoMaster stops, the standby TajoMaster
will become the active node.
+* Preservation of the ongoing query in the cluster: Even if the active TajoMaster stops,
the ongoing query will still complete in the cluster.
+
+
+================================================
+  Terminology
+================================================
+
+* Active master: TajoMaster that is actively serving the all operation from TajoClient and
TajoWorker.
+* Backup master: This TajoMaster waits becomes active when the Active dies or unhealthy.
Users can setup multiple back TajoMaster, and this servers monitors the Active status to become
active.
+
+
+================================================
+  Configuration File Settings
+================================================
+
+If you want to use TajoMaster HA mode, specific your ``tajo.master.ha.enable`` as follows:
+
+.. code-block:: xml
+
+  <property>
+    <name>tajo.master.ha.enable</name>
+    <value>true</value>
+  </property>
+
+If you use HA mode, all back masters monitor the active master at 5 second intervals. If
you update this period, specific your ``tajo.master.ha.monitor.interval`` as follows:
+
+.. code-block:: xml
+
+  <property>
+    <name>tajo.master.ha.monitor.interval</name>
+    <value>monitor interval</value>
+  </property>
+
+
+================================================
+  Backup Master Settings
+================================================
+
+If you want to run masters with ``start-tajo.sh``, specific your masters in ``conf/masters``.
The file lists all host names of masters, one per line.By default, this file contains the
single entry ``localhost``. You can easily add host names of workers via your favorite text
editor.
+
+For example: ::
+
+  $ cat > conf/masters
+  host1.domain.com
+  host2.domain.com
+  ....
+
+  <ctrl + d>
+
+And then, you need to setup tarball and set configuration files on backup masters.
+
+.. note::
+
+  If you want to run active master and backup master on the same host, you may find tajo
master port conflicts. To avoid this problem, you must convert backup master primary ports
to another port in ``tajo-site.xml`` as follows:
+
+  .. code-block:: xml
+
+    <property>
+      <name>tajo.master.umbilical-rpc.address</name>
+      <value>localhost:36001</value>
+      <description>The default port is 26001.</description>
+    </property>
+
+    <property>
+      <name>tajo.master.client-rpc.address</name>
+      <value>localhost:36002</value>
+      <description>The default port is 26002.</description>
+    </property>
+
+    <property>
+      <name>tajo.resource-tracker.rpc.address</name>
+      <value>localhost:36003</value>
+      <description>The default port is 26003.</description>
+      </property>
+
+    <property>
+      <name>tajo.catalog.client-rpc.address</name>
+      <value>localhost:36005</value>
+      <description>The default port is 26005.</description>
+    </property>
+
+    <property>
+      <name>tajo.master.info-http.address</name>
+      <value>0.0.0.0:36080</value>
+      <description>The default port is 26080.</description>
+    </property>
+
+
+  And you need to convert ``TAJO_PID_DIR`` to another directory in ``tajo-env.sh``.
+
+
+================================================
+  Launch a Tajo cluster
+================================================
+
+Then, execute ``start-tajo.sh`` ::
+
+  $ $TAJO_HOME/bin/start-tajo.sh
+
+.. note::
+
+  You can't use HA mode in DerbyStore. Currently, just one tajo master invoke the derby.
If another master try to invoke it, it never run itself. Also, if you set another catalog
uri for backup master, it is a incorrect configuration. Because they are unequal in every
way.
+
+================================================
+  Administration HA state
+================================================
+
+If you want to transit any backup master to active master, execute ``tajo hadmin -transitionToActive``
::
+
+  $ $TAJO_HOME/bin/tajo haadmin -transitionToActive <target tajo.master.umbilical-rpc.address>
+
+If you want to transit any active master to backup master, execute ``tajo hadmin -transitionToBackup``
::
+
+  $ $TAJO_HOME/bin/tajo haadmin -transitionToBackup <target tajo.master.umbilical-rpc.address>
+
+If you want to find the state of any master, execute ``tajo hadmin -getState`` ::
+
+  $ $TAJO_HOME/bin/tajo haadmin -getState <target tajo.master.umbilical-rpc.address>
+
+If you want to initiate HA information, execute ``tajo haadmin -formatHA`` ::
+
+  $ $TAJO_HOME/bin/tajo haadmin -formatHA
+
+.. note::
+
+  Before format HA, you must shutdown the tajo cluster.
\ No newline at end of file

Modified: tajo/site/docs/current/_sources/getting_started/building.txt
URL: http://svn.apache.org/viewvc/tajo/site/docs/current/_sources/getting_started/building.txt?rev=1628871&r1=1628870&r2=1628871&view=diff
==============================================================================
--- tajo/site/docs/current/_sources/getting_started/building.txt (original)
+++ tajo/site/docs/current/_sources/getting_started/building.txt Thu Oct  2 00:36:30 2014
@@ -11,9 +11,17 @@ You can compile source code and get a bi
 .. code-block:: bash
 
   $ cd tajo-x.y.z
-  $ mvn clean install -DskipTests -Pdist -Dtar
+  $ mvn clean install -DskipTests -Pdist -Dtar -Dhadoop.version=2.X.X
   $ ls tajo-dist/target/tajo-x.y.z-SNAPSHOT.tar.gz
 
+.. note::
+
+  If you don't specify the hadoop version, tajo cluster may not run correctly. Thus, we highly
recommend that you specify your hadoop version with maven build command.
+
+  Example:
+
+    $ mvn clean install -DskipTests -Pdist -Dtar -Dhadoop.version=2.5.1
+
 Then, after you move some proper directory, discompress the tar.gz file as follows:
 
 .. code-block:: bash

Modified: tajo/site/docs/current/_sources/sql_language/data_model.txt
URL: http://svn.apache.org/viewvc/tajo/site/docs/current/_sources/sql_language/data_model.txt?rev=1628871&r1=1628870&r2=1628871&view=diff
==============================================================================
--- tajo/site/docs/current/_sources/sql_language/data_model.txt (original)
+++ tajo/site/docs/current/_sources/sql_language/data_model.txt Thu Oct  2 00:36:30 2014
@@ -7,7 +7,7 @@ Data Types
 ===============
 
 +-----------+----------------+----------------------------+-------------+---------------------------------------------------+--------------------------------------------------------------------------+

-| Supported | SQL Type Name  |  Alias                     | Size (byte) | Description   
                                   | Range                                               
                    |
+| Support   | SQL Type Name  |  Alias                     | Size (byte) | Description   
                                   | Range                                               
                    |
 +===========+================+============================+=============+===================================================+==========================================================================+

 | O         | boolean        |  bool                      |  1          |               
                                   | true/false                                          
                    |
 +-----------+----------------+----------------------------+-------------+---------------------------------------------------+--------------------------------------------------------------------------+
 
@@ -41,13 +41,13 @@ Data Types
 +-----------+----------------+----------------------------+-------------+---------------------------------------------------+--------------------------------------------------------------------------+

 | O         | blob           |  bytea                     |             | variable-length
binary string                     |                                                      
                   |
 +-----------+----------------+----------------------------+-------------+---------------------------------------------------+--------------------------------------------------------------------------+

-|           | date           |                            |             |               
                                   |                                                     
                    | 
+| O         | date           |                            |             |               
                                   |                                                     
                    | 
 +-----------+----------------+----------------------------+-------------+---------------------------------------------------+--------------------------------------------------------------------------+

-|           | time           |                            |             |               
                                   |                                                     
                    | 
+| O         | time           |                            |             |               
                                   |                                                     
                    | 
 +-----------+----------------+----------------------------+-------------+---------------------------------------------------+--------------------------------------------------------------------------+

 |           | timetz         |  time with time zone       |             |               
                                   |                                                     
                    |
 +-----------+----------------+----------------------------+-------------+---------------------------------------------------+--------------------------------------------------------------------------+

-|           | timestamp      |                            |             |               
                                   |                                                     
                    |
+| O         | timestamp      |                            |             |               
                                   |                                                     
                    |
 +-----------+----------------+----------------------------+-------------+---------------------------------------------------+--------------------------------------------------------------------------+

 |           | timestamptz    |                            |             |               
                                   |                                                     
                    |
 +-----------+----------------+----------------------------+-------------+---------------------------------------------------+--------------------------------------------------------------------------+


Modified: tajo/site/docs/current/_sources/sql_language/queries.txt
URL: http://svn.apache.org/viewvc/tajo/site/docs/current/_sources/sql_language/queries.txt?rev=1628871&r1=1628870&r2=1628871&view=diff
==============================================================================
--- tajo/site/docs/current/_sources/sql_language/queries.txt (original)
+++ tajo/site/docs/current/_sources/sql_language/queries.txt Thu Oct  2 00:36:30 2014
@@ -11,7 +11,7 @@ Overview
 .. code-block:: sql
 
   SELECT [distinct [all]] * | <expression> [[AS] <alias>] [, ...]
-    [FROM <table name> [[AS] <table alias name>] [, ...]]
+    [FROM <table reference> [[AS] <table alias name>] [, ...]]
     [WHERE <condition>]
     [GROUP BY <expression> [, ...]]
     [HAVING <condition>]
@@ -23,16 +23,234 @@ Overview
 From Clause
 =====================
 
+*Synopsis*
+
+.. code-block:: sql
+
+  [FROM <table reference> [[AS] <table alias name>] [, ...]]
+
+
+The ``FROM`` clause specifies one or more other tables given in a comma-separated table reference
list.
+A table reference can be a relation name , or a subquery, a table join, or complex combinations
of them.
+
+-----------------------
+Table and Table Aliases
+-----------------------
+
+A temporary name can be given to tables and complex table references to be used
+for references to the derived table in the rest of the query. This is called a table alias.
+
+To create a a table alias, please use ``AS``:
+
+.. code-block:: sql
+
+  FROM table_reference AS alias
+
+or
+
+.. code-block:: sql
+
+  FROM table_reference alias
+
+The ``AS`` keyword can be omitted, and *Alias* can be any identifier.
+
+A typical application of table aliases is to give short names to long table references. For
example:
+
+.. code-block:: sql
+
+  SELECT * FROM long_table_name_1234 s JOIN another_long_table_name_5678 a ON s.id = a.num;
+
+-------------
+Joined Tables
+-------------
+
+Tajo supports all kinds of join types.
+
+Join Types
+~~~~~~~~~~
+
+Cross Join
+^^^^^^^^^^
+
+.. code-block:: sql
+
+  FROM T1 CROSS JOIN T2
+
+Cross join, also called *Cartesian product*, results in every possible combination of rows
from T1 and T2.
+
+``FROM T1 CROSS JOIN T2`` is equivalent to ``FROM T1, T2``.
+
+Qualified joins
+^^^^^^^^^^^^^^^
+
+Qualified joins implicitly or explicitly have join conditions. Inner/Outer/Natural Joins
all are qualified joins.
+Except for natural join, ``ON`` or ``USING`` clause in each join is used to specify a join
condition. 
+A join condition must include at least one boolean expression, and it can also include just
filter conditions.
+
+**Inner Join**
+
+.. code-block:: sql
+
+  T1 [INNER] JOIN T2 ON boolean_expression
+  T1 [INNER] JOIN T2 USING (join column list)
+
+``INNER`` keyword is the default, and so ``INNER`` can be omitted when you use inner join.
+
+**Outer Join**
+
+.. code-block:: sql
+
+  T1 (LEFT|RIGHT|FULL) OUTER JOIN T2 ON boolean_expression
+  T1 (LEFT|RIGHT|FULL) OUTER JOIN T2 USING (join column list)
+
+One of ``LEFT``, ``RIGHT``, or ``FULL`` must be specified for outer joins. 
+Join conditions in outer join will have different behavior according to corresponding table
references of join conditions.
+To know outer join behavior in more detail, please refer to 
+`Advanced outer join constructs <http://www.ibm.com/developerworks/data/library/techarticle/purcell/0201purcell.html>`_.
+
+**Natural Join**
+
+.. code-block:: sql
+
+  T1 NATURAL JOIN T2
+
+``NATURAL`` is a short form of ``USING``. It forms a ``USING`` list consisting of all common
column names that appear in 
+both join tables. These common columns appear only once in the output table. If there are
no common columns, 
+``NATURAL`` behaves like ``CROSS JOIN``.
+
+**Subqueries**
+
+Subqueries allow users to specify a derived table. It requires enclosing a SQL statement
in parentheses and an alias name. 
+For example:
+
+.. code-block:: sql
+
+  FROM (SELECT * FROM table1) AS alias_name
 
 =====================
 Where Clause
 =====================
 
+The syntax of the WHERE Clause is
 
-=====================
-Groupby Clause
-=====================
+*Synopsis*
 
-=====================
-Select list
-=====================
\ No newline at end of file
+.. code-block:: sql
+
+  WHERE search_condition
+
+``search_condition`` can be any boolean expression. 
+In order to know additional predicates, please refer to :doc:`/sql_language/predicates`.
+
+==========================
+Groupby and Having Clauses
+==========================
+
+*Synopsis*
+
+.. code-block:: sql
+
+  SELECT select_list
+      FROM ...
+      [WHERE ...]
+      GROUP BY grouping_column_reference [, grouping_column_reference]...
+      [HAVING boolean_expression]
+
+The rows which passes ``WHERE`` filter may be subject to grouping, specified by ``GROUP BY``
clause.
+Grouping combines a set of rows having common values into one group, and then computes rows
in the group with aggregation functions. ``HAVING`` clause can be used with only ``GROUP BY``
clause. It eliminates the unqualified result rows of grouping.
+
+``grouping_column_reference`` can be a column reference, a complex expression including scalar
functions and arithmetic operations.
+
+.. code-block:: sql
+
+  SELECT l_orderkey, SUM(l_quantity) AS quantity FROM lineitem GROUP BY l_orderkey;
+
+  SELECT substr(l_shipdate,1,4) as year, SUM(l_orderkey) AS total2 FROM lineitem GROUP BY
substr(l_shipdate,1,4);
+
+If a SQL statement includes ``GROUP BY`` clause, expressions in select list must be either
grouping_column_reference or aggregation function. For example, the following example query
is not allowed because ``l_orderkey`` does not occur in ``GROUP BY`` clause.
+
+.. code-block:: sql
+
+  SELECT l_orderkey, l_partkey, SUM(l_orderkey) AS total FROM lineitem GROUP BY l_partkey;
+
+Aggregation functions can be used with ``DISTINCT`` keywords. It forces an individual aggregate
function to take only distinct values of the argument expression. ``DISTINCT`` keyword is
used as follows:
+
+.. code-block:: sql
+
+  SELECT l_partkey, COUNT(distinct l_quantity), SUM(distinct l_extendedprice) AS total FROM
lineitem GROUP BY l_partkey;
+
+==========================
+Orderby and Limit Clauses
+==========================
+
+*Synopsis*
+
+.. code-block:: sql
+
+  FROM ... ORDER BY <sort_expr> [(ASC|DESC)] [NULL (FIRST|LAST) [,...]
+
+``sort_expr`` can be a column reference, aliased column reference, or a complex expression.

+``ASC`` indicates an ascending order of ``sort_expr`` values. ``DESC`` indicates a descending
order of ``sort_expr`` values.
+``ASC`` is the default order.
+
+``NULLS FIRST`` and ``NULLS LAST`` options can be used to determine whether nulls values
appear 
+before or after non-null values in the sort ordering. By default, null values are dealt as
if larger than any non-null value; 
+that is, ``NULLS FIRST`` is the default for ``DESC`` order, and ``NULLS LAST`` otherwise.
+
+==========================
+Window Functions
+==========================
+
+A window function performs a calculation across multiple table rows that belong to some window
frame.
+
+*Synopsis*
+
+.. code-block:: sql
+
+  SELECT ...., func(param) OVER ([PARTITION BY partition-expr [, ...]] [ORDER BY sort-expr
[, ...]]), ....,  FROM
+
+The PARTITION BY list within OVER specifies dividing the rows into groups, or partitions,
that share the same values of 
+the PARTITION BY expression(s). For each row, the window function is computed across the
rows that fall into 
+the same partition as the current row.
+
+We will briefly explain some examples using window functions.
+
+---------
+Examples
+---------
+
+Multiple window functions can be used in a SQL statement as follows:
+
+.. code-block:: sql
+
+  SELECT l_orderkey, sum(l_discount) OVER (PARTITION BY l_orderkey), sum(l_quantity) OVER
(PARTITION BY l_orderkey) FROM LINEITEM;
+
+If ``OVER()`` clause is empty as following, it makes all table rows into one window frame.
+
+.. code-block:: sql
+
+  SELECT salary, sum(salary) OVER () FROM empsalary;
+
+Also, ``ORDER BY`` clause can be used without ``PARTITION BY`` clause as follows:
+
+.. code-block:: sql
+
+  SELECT salary, sum(salary) OVER (ORDER BY salary) FROM empsalary;
+
+Also, all expressions and aggregation functions are allowed in ``ORDER BY`` clause as follows:
+
+.. code-block:: sql
+
+  select
+    l_orderkey,
+    count(*) as cnt,
+    row_number() over (partition by l_orderkey order by count(*) desc)
+    row_num
+  from
+    lineitem
+  group by
+    l_orderkey
+
+.. note::
+
+  Currently, Tajo does not support multiple different partition-expressions in one SQL statement.
\ No newline at end of file

Modified: tajo/site/docs/current/_static/basic.css
URL: http://svn.apache.org/viewvc/tajo/site/docs/current/_static/basic.css?rev=1628871&r1=1628870&r2=1628871&view=diff
==============================================================================
--- tajo/site/docs/current/_static/basic.css (original)
+++ tajo/site/docs/current/_static/basic.css Thu Oct  2 00:36:30 2014
@@ -4,7 +4,7 @@
  *
  * Sphinx stylesheet -- basic theme.
  *
- * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
  * :license: BSD, see LICENSE for details.
  *
  */
@@ -79,16 +79,17 @@ div.sphinxsidebar input {
     font-size: 1em;
 }
 
-div.sphinxsidebar input[type="text"] {
+div.sphinxsidebar #searchbox input[type="text"] {
     width: 170px;
 }
 
-div.sphinxsidebar input[type="submit"] {
+div.sphinxsidebar #searchbox input[type="submit"] {
     width: 30px;
 }
 
 img {
     border: 0;
+    max-width: 100%;
 }
 
 /* -- search page ----------------------------------------------------------- */
@@ -401,10 +402,6 @@ dl.glossary dt {
     margin: 0;
 }
 
-.refcount {
-    color: #060;
-}
-
 .optional {
     font-size: 1.3em;
 }

Modified: tajo/site/docs/current/_static/doctools.js
URL: http://svn.apache.org/viewvc/tajo/site/docs/current/_static/doctools.js?rev=1628871&r1=1628870&r2=1628871&view=diff
==============================================================================
--- tajo/site/docs/current/_static/doctools.js (original)
+++ tajo/site/docs/current/_static/doctools.js Thu Oct  2 00:36:30 2014
@@ -4,7 +4,7 @@
  *
  * Sphinx JavaScript utilities for all documentation.
  *
- * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
  * :license: BSD, see LICENSE for details.
  *
  */
@@ -32,7 +32,7 @@ if (!window.console || !console.firebug)
  */
 jQuery.urldecode = function(x) {
   return decodeURIComponent(x).replace(/\+/g, ' ');
-}
+};
 
 /**
  * small helper function to urlencode strings
@@ -62,18 +62,6 @@ jQuery.getQueryParameters = function(s) 
 };
 
 /**
- * small function to check if an array contains
- * a given item.
- */
-jQuery.contains = function(arr, item) {
-  for (var i = 0; i < arr.length; i++) {
-    if (arr[i] == item)
-      return true;
-  }
-  return false;
-};
-
-/**
  * highlight a given string on a jquery object by wrapping it in
  * span elements with the given class name.
  */
@@ -180,6 +168,9 @@ var Documentation = {
     var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
     if (terms.length) {
       var body = $('div.body');
+      if (!body.length) {
+        body = $('body');
+      }
       window.setTimeout(function() {
         $.each(terms, function() {
           body.highlightText(this.toLowerCase(), 'highlighted');



Mime
View raw message