Java Doc for IndexReader.java in  » Search-Engine » mg4j » it » unimi » dsi » mg4j » index » 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 » Search Engine » mg4j » it.unimi.dsi.mg4j.index 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


it.unimi.dsi.mg4j.index.IndexReader

All known Subclasses:   it.unimi.dsi.mg4j.index.AbstractIndexReader,
IndexReader
public interface IndexReader extends SafelyCloseable(Code)
Provides access to an inverted index.

An it.unimi.dsi.mg4j.index.Index contains global read-only metadata. To get actual data from an index, you need to get an index reader via a call to Index.getReader . Once you have an index reader, you can ask for the .

Alternatively, you can perform a read-once scan of the index calling IndexReader.nextIterator() , which will return in order the of all terms of the underlying index. More generally, IndexReader.nextIterator() returns an iterator positioned at the start of the inverted list of the term after the current one. When called just after the reader creation, it returns an index iterator for the first term.

Warning: An index reader is exactly what it looks like—a reader. It cannot be used by many threads at the same time, and all its access methods are exclusive: if you obtain a , the previous one is no longer valid. However, you can generate many readers, and use them concurrently.

Warning: Invoking the it.unimi.dsi.mg4j.search.DocumentIterator.dispose method on iterators returned by an instance of this class will invoke IndexReader.close() on the instance, thus making the instance no longer accessible. This behaviour is necessary to handle cases in which a reader is created on-the-fly just to create an iterator.

Warning: As of MG4J 1.2, direct (i.e., bit-level) access to an inverted index is no longer possible.
author:
   Paolo Boldi
author:
   Sebastiano Vigna
since:
   1.0





Method Summary
public  IndexIteratordocuments(int termNumber)
     Returns a document iterator over the documents containing a term.
public  IndexIteratordocuments(CharSequence term)
     Returns an index iterator over the documents containing a term; the term is given explicitly.
public  IndexIteratornextIterator()
     Returns an IndexIterator on the term after the current one (optional operation).

Note that after creation there is no current term.




Method Detail
documents
public IndexIterator documents(int termNumber) throws IOException(Code)
Returns a document iterator over the documents containing a term.

Note that the index iterator returned by this method will return null on a call to IndexIterator.term term() .

Note that it is always possible to call this method with argument 0, even if the underlying index does not provide random access.
Parameters:
  termNumber - the number of a term.
throws:
  UnsupportedOperationException - if this index reader is not accessible by termnumber.




documents
public IndexIterator documents(CharSequence term) throws IOException(Code)
Returns an index iterator over the documents containing a term; the term is given explicitly.

Unless the of the associated index is null, words coming from a query will have to be processed before being used with this method.

Note that the index iterator returned by this method will return term on a call to IndexIterator.term term() .
Parameters:
  term - a term (the term will be downcased if the index is case insensitive).
throws:
  UnsupportedOperationException - if the is not available for the underlying index.




nextIterator
public IndexIterator nextIterator() throws IOException(Code)
Returns an IndexIterator on the term after the current one (optional operation).

Note that after creation there is no current term. Thus, the first call to this method will return an IndexIterator on the first term. As a consequence, repeated calls to this method provide a way to scan sequentially an index. the index iterator of the next term, or null if there are no more termsafter the current one.




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