Browse files

documentation of future features.

  • Loading branch information...
1 parent 697884b commit a40523d37bb2f0925f7b01926a40e6ef0f651e48 Robert Newson committed Apr 21, 2009
Showing with 19 additions and 10 deletions.
  1. +19 −10
@@ -79,6 +79,12 @@ The following indexing options can be defaulted;
<th>available options</th>
+ <tr>
+ <th>field</th>
+ <td>the field name to index under</td>
+ <td>user-defined</td>
+ <td>default</td>
+ </tr>
<td>whether the data is stored</td>
@@ -113,27 +119,30 @@ You may construct a new Document instance with;
var doc = new Document();
-Several functions are available that populate a Document.
+Data may be added to this document with the add method which takes an optional second object argument that can override any of the above default values.
-// Indexed, analyzed but not stored.
-doc.field("name", "value");
+// Add with all the defaults.
+// Add a subject field.
+doc.add("this is the subject line.", {"field":"subject"});
-// Indexed, analyzed and stored.
-doc.field("name", "value", "yes");
+// Add but ensure it's stored.
+doc.add("value", {"store":"yes"});
-// Indexed, stored but not analyzed.
-doc.field("name", "value", "yes", "not_analyzed");
+// Add but don't analyze.
+doc.add("don't analyze me", {"index":"not_analyzed"});
// Extract text from the named attachment and index it (but not store it).
-doc.attachment("name", "attachment name");
+doc.attachment("attachment name", {"field":"attachments"});
// Interpret "value" as a date using the default date formats."name", "value");
+doc.add("2009-01-01T00:00:00Z", {"type":"date"});
// intrepret "value" as a date using the supplied format string
// (see Java's SimpleDateFormat class for the syntax)."name", "value", "format");
+doc.add("2009-01-01", {"type":"date", "date_format":"YYYY-MM-dd"});
<h3>Example Transforms</h3>

0 comments on commit a40523d

Please sign in to comment.