Java Doc for Document.java in  » Net » lucene-connector » org » apache » lucene » document » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » lucene connector » org.apache.lucene.document 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.lucene.document.Document

Document
final public class Document implements java.io.Serializable(Code)
Documents are the unit of indexing and search. A Document is a set of fields. Each field has a name and a textual value. A field may be Fieldable.isStored stored with the document, in which case it is returned with search hits on the document. Thus each document should typically contain one or more stored fields which uniquely identify it.

Note that fields which are not Fieldable.isStored stored are not available in documents retrieved from the index, e.g. with Hits.doc(int) , Searcher.doc(int) or IndexReader.document(int) .



Field Summary
 Listfields
    

Constructor Summary
public  Document()
     Constructs a new document with no fields.

Method Summary
final public  voidadd(Fieldable field)
    

Adds a field to a document.

final public  Enumerationfields()
     Returns an Enumeration of all the fields in a document.
final public  Stringget(String name)
     Returns the string value of the field with the given name if any exist in this document, or null.
final public  byte[]getBinaryValue(String name)
     Returns an array of bytes for the first (or only) field that has the name specified as the method parameter.
final public  byte[][]getBinaryValues(String name)
     Returns an array of byte arrays for of the fields that have the name specified as the method parameter.
public  floatgetBoost()
     Returns, at indexing time, the boost factor as set by Document.setBoost(float) .
final public  FieldgetField(String name)
     Returns a field with the given name if any exist in this document, or null.
public  FieldablegetFieldable(String name)
     Returns a field with the given name if any exist in this document, or null.
public  Fieldable[]getFieldables(String name)
     Returns an array of Fieldable s with the given name.
final public  ListgetFields()
     Returns a List of all the fields in a document.

Note that fields which are not Fieldable.isStored stored are not available in documents retrieved from the index, e.g.

final public  Field[]getFields(String name)
     Returns an array of Field s with the given name.
final public  String[]getValues(String name)
     Returns an array of values of the field specified as the method parameter.
final public  voidremoveField(String name)
    

Removes field with the specified name from the document. If multiple fields exist with this name, this method removes the first field that has been added. If there is no field with the specified name, the document remains unchanged.

Note that the removeField(s) methods like the add method only make sense prior to adding a document to an index.

final public  voidremoveFields(String name)
    

Removes all fields with the given name from the document. If there is no field with the specified name, the document remains unchanged.

Note that the removeField(s) methods like the add method only make sense prior to adding a document to an index.

public  voidsetBoost(float boost)
     Sets a boost factor for hits on any field of this document.
final public  StringtoString()
     Prints the fields of a document for human consumption.

Field Detail
fields
List fields(Code)




Constructor Detail
Document
public Document()(Code)
Constructs a new document with no fields.




Method Detail
add
final public void add(Fieldable field)(Code)

Adds a field to a document. Several fields may be added with the same name. In this case, if the fields are indexed, their text is treated as though appended for the purposes of search.

Note that add like the removeField(s) methods only makes sense prior to adding a document to an index. These methods cannot be used to change the content of an existing index! In order to achieve this, a document has to be deleted from an index and a new changed version of that document has to be added.




fields
final public Enumeration fields()(Code)
Returns an Enumeration of all the fields in a document. Document.getFields()



get
final public String get(String name)(Code)
Returns the string value of the field with the given name if any exist in this document, or null. If multiple fields exist with this name, this method returns the first value added. If only binary fields with this name exist, returns null.



getBinaryValue
final public byte[] getBinaryValue(String name)(Code)
Returns an array of bytes for the first (or only) field that has the name specified as the method parameter. This method will return null if no binary fields with the specified name are available. There may be non-binary fields with the same name.
Parameters:
  name - the name of the field. a byte[] containing the binary field value or null



getBinaryValues
final public byte[][] getBinaryValues(String name)(Code)
Returns an array of byte arrays for of the fields that have the name specified as the method parameter. This method will return null if no binary fields with the specified name are available.
Parameters:
  name - the name of the field a byte[][] of binary field values or null



getBoost
public float getBoost()(Code)
Returns, at indexing time, the boost factor as set by Document.setBoost(float) .

Note that once a document is indexed this value is no longer available from the index. At search time, for retrieved documents, this method always returns 1. This however does not mean that the boost value set at indexing time was ignored - it was just combined with other indexing time factors and stored elsewhere, for better indexing and search performance. (For more information see the "norm(t,d)" part of the scoring formula in org.apache.lucene.search.Similarity Similarity .)
See Also:   Document.setBoost(float)




getField
final public Field getField(String name)(Code)
Returns a field with the given name if any exist in this document, or null. If multiple fields exists with this name, this method returns the first value added. Do not use this method with lazy loaded fields.



getFieldable
public Fieldable getFieldable(String name)(Code)
Returns a field with the given name if any exist in this document, or null. If multiple fields exists with this name, this method returns the first value added.



getFieldables
public Fieldable[] getFieldables(String name)(Code)
Returns an array of Fieldable s with the given name. This method can return null.
Parameters:
  name - the name of the field a Fieldable[] array or null



getFields
final public List getFields()(Code)
Returns a List of all the fields in a document.

Note that fields which are not Fieldable.isStored stored are not available in documents retrieved from the index, e.g. with Hits.doc(int) , Searcher.doc(int) or IndexReader.document(int) .




getFields
final public Field[] getFields(String name)(Code)
Returns an array of Field s with the given name. This method can return null. Do not use with lazy loaded fields.
Parameters:
  name - the name of the field a Field[] array



getValues
final public String[] getValues(String name)(Code)
Returns an array of values of the field specified as the method parameter. This method can return null.
Parameters:
  name - the name of the field a String[] of field values or null



removeField
final public void removeField(String name)(Code)

Removes field with the specified name from the document. If multiple fields exist with this name, this method removes the first field that has been added. If there is no field with the specified name, the document remains unchanged.

Note that the removeField(s) methods like the add method only make sense prior to adding a document to an index. These methods cannot be used to change the content of an existing index! In order to achieve this, a document has to be deleted from an index and a new changed version of that document has to be added.




removeFields
final public void removeFields(String name)(Code)

Removes all fields with the given name from the document. If there is no field with the specified name, the document remains unchanged.

Note that the removeField(s) methods like the add method only make sense prior to adding a document to an index. These methods cannot be used to change the content of an existing index! In order to achieve this, a document has to be deleted from an index and a new changed version of that document has to be added.




setBoost
public void setBoost(float boost)(Code)
Sets a boost factor for hits on any field of this document. This value will be multiplied into the score of all hits on this document.

The default value is 1.0.

Values are multiplied into the value of Fieldable.getBoost of each field in this document. Thus, this method in effect sets a default boost for the fields of this document.
See Also:   Fieldable.setBoost(float)




toString
final public String toString()(Code)
Prints the fields of a document for human consumption.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.