Java Doc for FieldSortedHitQueue.java in  » Net » lucene-connector » org » apache » lucene » search » 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.search 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.lucene.util.PriorityQueue
      org.apache.lucene.search.FieldSortedHitQueue

FieldSortedHitQueue
public class FieldSortedHitQueue extends PriorityQueue (Code)
Expert: A hit queue for sorting by hits by terms in more than one field. Uses FieldCache.DEFAULT for maintaining internal term lookup tables.

Created: Dec 8, 2003 12:56:03 PM
author:
   Tim Jones (Nacimiento Software)
since:
   lucene 1.4
version:
   $Id: FieldSortedHitQueue.java 605225 2007-12-18 15:13:05Z gsingers $
See Also:   Searcher.search(QueryFilterintSort)
See Also:   FieldCache



Field Summary
final static  FieldCacheImpl.CacheComparators
     Internal cache of comparators.
protected  ScoreDocComparator[]comparators
    
protected  SortField[]fields
     Stores the sort criteria being used.
protected  floatmaxscore
     Stores the maximum score value encountered, needed for normalizing.

Constructor Summary
public  FieldSortedHitQueue(IndexReader reader, SortField[] fields, int size)
     Creates a hit queue sorted by the given list of fields.
Parameters:
  reader - Index to use.
Parameters:
  fields - Fieldable names, in priority order (highest priority first).

Method Summary
static  ScoreDocComparatorcomparatorAuto(IndexReader reader, String fieldname)
     Returns a comparator for sorting hits according to values in the given field. The terms in the field are looked at to determine whether they contain integers, floats or strings.
static  ScoreDocComparatorcomparatorDouble(IndexReader reader, String fieldname)
     Returns a comparator for sorting hits according to a field containing doubles.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg float values.
static  ScoreDocComparatorcomparatorFloat(IndexReader reader, String fieldname)
     Returns a comparator for sorting hits according to a field containing floats.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg float values.
static  ScoreDocComparatorcomparatorInt(IndexReader reader, String fieldname)
     Returns a comparator for sorting hits according to a field containing integers.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg integer values.
static  ScoreDocComparatorcomparatorLong(IndexReader reader, String fieldname)
     Returns a comparator for sorting hits according to a field containing integers.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg integer values.
static  ScoreDocComparatorcomparatorString(IndexReader reader, String fieldname)
     Returns a comparator for sorting hits according to a field containing strings.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg string values.
static  ScoreDocComparatorcomparatorStringLocale(IndexReader reader, String fieldname, Locale locale)
     Returns a comparator for sorting hits according to a field containing strings.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg string values.
 FieldDocfillFields(FieldDoc doc)
     Given a FieldDoc object, stores the values used to sort the given document.
static  ScoreDocComparatorgetCachedComparator(IndexReader reader, String field, int type, Locale locale, SortComparatorSource factory)
    
 SortField[]getFields()
     Returns the SortFields being used by this hit queue.
public  floatgetMaxScore()
    
public  booleaninsert(FieldDoc fdoc)
    
public  booleaninsert(Object fdoc)
    
public  ObjectinsertWithOverflow(Object element)
    
protected  booleanlessThan(Object a, Object b)
     Returns whether a is less relevant than b.

Field Detail
Comparators
final static FieldCacheImpl.Cache Comparators(Code)
Internal cache of comparators. Similar to FieldCache, only caches comparators instead of term values.



comparators
protected ScoreDocComparator[] comparators(Code)
Stores a comparator corresponding to each field being sorted by



fields
protected SortField[] fields(Code)
Stores the sort criteria being used.



maxscore
protected float maxscore(Code)
Stores the maximum score value encountered, needed for normalizing.




Constructor Detail
FieldSortedHitQueue
public FieldSortedHitQueue(IndexReader reader, SortField[] fields, int size) throws IOException(Code)
Creates a hit queue sorted by the given list of fields.
Parameters:
  reader - Index to use.
Parameters:
  fields - Fieldable names, in priority order (highest priority first). Cannot be null or empty.
Parameters:
  size - The number of hits to retain. Must be greater than zero.
throws:
  IOException -




Method Detail
comparatorAuto
static ScoreDocComparator comparatorAuto(IndexReader reader, String fieldname) throws IOException(Code)
Returns a comparator for sorting hits according to values in the given field. The terms in the field are looked at to determine whether they contain integers, floats or strings. Once the type is determined, one of the other static methods in this class is called to get the comparator.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg values. Comparator for sorting hits.
throws:
  IOException - If an error occurs reading the index.



comparatorDouble
static ScoreDocComparator comparatorDouble(IndexReader reader, String fieldname) throws IOException(Code)
Returns a comparator for sorting hits according to a field containing doubles.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg float values. Comparator for sorting hits.
throws:
  IOException - If an error occurs reading the index.



comparatorFloat
static ScoreDocComparator comparatorFloat(IndexReader reader, String fieldname) throws IOException(Code)
Returns a comparator for sorting hits according to a field containing floats.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg float values. Comparator for sorting hits.
throws:
  IOException - If an error occurs reading the index.



comparatorInt
static ScoreDocComparator comparatorInt(IndexReader reader, String fieldname) throws IOException(Code)
Returns a comparator for sorting hits according to a field containing integers.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg integer values. Comparator for sorting hits.
throws:
  IOException - If an error occurs reading the index.



comparatorLong
static ScoreDocComparator comparatorLong(IndexReader reader, String fieldname) throws IOException(Code)
Returns a comparator for sorting hits according to a field containing integers.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg integer values. Comparator for sorting hits.
throws:
  IOException - If an error occurs reading the index.



comparatorString
static ScoreDocComparator comparatorString(IndexReader reader, String fieldname) throws IOException(Code)
Returns a comparator for sorting hits according to a field containing strings.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg string values. Comparator for sorting hits.
throws:
  IOException - If an error occurs reading the index.



comparatorStringLocale
static ScoreDocComparator comparatorStringLocale(IndexReader reader, String fieldname, Locale locale) throws IOException(Code)
Returns a comparator for sorting hits according to a field containing strings.
Parameters:
  reader - Index to use.
Parameters:
  fieldname - Fieldable containg string values. Comparator for sorting hits.
throws:
  IOException - If an error occurs reading the index.



fillFields
FieldDoc fillFields(FieldDoc doc)(Code)
Given a FieldDoc object, stores the values used to sort the given document. These values are not the raw values out of the index, but the internal representation of them. This is so the given search hit can be collated by a MultiSearcher with other search hits.
Parameters:
  doc - The FieldDoc to store sort values into. The same FieldDoc passed in.
See Also:   Searchable.search(WeightFilterintSort)



getCachedComparator
static ScoreDocComparator getCachedComparator(IndexReader reader, String field, int type, Locale locale, SortComparatorSource factory) throws IOException(Code)



getFields
SortField[] getFields()(Code)
Returns the SortFields being used by this hit queue.



getMaxScore
public float getMaxScore()(Code)
returns the maximum score encountered by elements inserted via insert()



insert
public boolean insert(FieldDoc fdoc)(Code)



insert
public boolean insert(Object fdoc)(Code)



insertWithOverflow
public Object insertWithOverflow(Object element)(Code)



lessThan
protected boolean lessThan(Object a, Object b)(Code)
Returns whether a is less relevant than b.
Parameters:
  a - ScoreDoc
Parameters:
  b - ScoreDoc true if document a should be sorted after document b.



Fields inherited from org.apache.lucene.util.PriorityQueue
protected Object[] heap(Code)(Java Doc)

Methods inherited from org.apache.lucene.util.PriorityQueue
final public void adjustTop()(Code)(Java Doc)
final public void clear()(Code)(Java Doc)
final protected void initialize(int maxSize)(Code)(Java Doc)
public boolean insert(Object element)(Code)(Java Doc)
public Object insertWithOverflow(Object element)(Code)(Java Doc)
abstract protected boolean lessThan(Object a, Object b)(Code)(Java Doc)
final public Object pop()(Code)(Java Doc)
final public void put(Object element)(Code)(Java Doc)
final public int size()(Code)(Java Doc)
final public Object top()(Code)(Java Doc)

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.