Java Doc for BooleanQuery.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.search.Query
      org.apache.lucene.search.BooleanQuery

BooleanQuery
public class BooleanQuery extends Query (Code)
A Query that matches documents matching boolean combinations of other queries, e.g. TermQuery s, PhraseQuery s or other BooleanQuerys.

Inner Class :public static class TooManyClauses extends RuntimeException

Field Summary
protected  intminNrShouldMatch
    

Constructor Summary
public  BooleanQuery()
     Constructs an empty boolean query.
public  BooleanQuery(boolean disableCoord)
     Constructs an empty boolean query. Similarity.coord(intint) may be disabled in scoring, as appropriate.

Method Summary
public  voidadd(Query query, BooleanClause.Occur occur)
     Adds a clause to a boolean query.
public  voidadd(BooleanClause clause)
     Adds a clause to a boolean query.
public  Listclauses()
     Returns the list of clauses in this query.
public  Objectclone()
    
protected  WeightcreateWeight(Searcher searcher)
    
public  booleanequals(Object o)
     Returns true iff o is equal to this.
public  voidextractTerms(Set terms)
    
public static  booleangetAllowDocsOutOfOrder()
     Whether hit docs may be collected out of docid order.
public  BooleanClause[]getClauses()
     Returns the set of clauses in this query.
public static  intgetMaxClauseCount()
     Return the maximum number of clauses permitted, 1024 by default.
public  intgetMinimumNumberShouldMatch()
     Gets the minimum number of the optional BooleanClauses which must be satisifed.
public  SimilaritygetSimilarity(Searcher searcher)
    
public static  booleangetUseScorer14()
    
public  inthashCode()
     Returns a hash code value for this object.
public  booleanisCoordDisabled()
     Returns true iff Similarity.coord(intint) is disabled in scoring for this query instance.
public  Queryrewrite(IndexReader reader)
    
public static  voidsetAllowDocsOutOfOrder(boolean allow)
     Expert: Indicates whether hit docs may be collected out of docid order.

Background: although the contract of the Scorer class requires that documents be iterated in order of doc id, this was not true in early versions of Lucene.

public static  voidsetMaxClauseCount(int maxClauseCount)
     Set the maximum number of clauses permitted per BooleanQuery. Default value is 1024.

TermQuery clauses are generated from for example prefix queries and fuzzy queries.

public  voidsetMinimumNumberShouldMatch(int min)
     Specifies a minimum number of the optional BooleanClauses which must be satisfied.

By default no optional clauses are necessary for a match (unless there are no required clauses).

public static  voidsetUseScorer14(boolean use14)
    
public  StringtoString(String field)
     Prints a user-readable version of this query.

Field Detail
minNrShouldMatch
protected int minNrShouldMatch(Code)




Constructor Detail
BooleanQuery
public BooleanQuery()(Code)
Constructs an empty boolean query.



BooleanQuery
public BooleanQuery(boolean disableCoord)(Code)
Constructs an empty boolean query. Similarity.coord(intint) may be disabled in scoring, as appropriate. For example, this score factor does not make sense for most automatically generated queries, like WildcardQuery and FuzzyQuery .
Parameters:
  disableCoord - disables Similarity.coord(intint) in scoring.




Method Detail
add
public void add(Query query, BooleanClause.Occur occur)(Code)
Adds a clause to a boolean query.
throws:
  TooManyClauses - if the new number of clauses exceeds the maximum clause number
See Also:   BooleanQuery.getMaxClauseCount()



add
public void add(BooleanClause clause)(Code)
Adds a clause to a boolean query.
throws:
  TooManyClauses - if the new number of clauses exceeds the maximum clause number
See Also:   BooleanQuery.getMaxClauseCount()



clauses
public List clauses()(Code)
Returns the list of clauses in this query.



clone
public Object clone()(Code)



createWeight
protected Weight createWeight(Searcher searcher) throws IOException(Code)



equals
public boolean equals(Object o)(Code)
Returns true iff o is equal to this.



extractTerms
public void extractTerms(Set terms)(Code)



getAllowDocsOutOfOrder
public static boolean getAllowDocsOutOfOrder()(Code)
Whether hit docs may be collected out of docid order.
See Also:   BooleanQuery.setAllowDocsOutOfOrder(boolean)



getClauses
public BooleanClause[] getClauses()(Code)
Returns the set of clauses in this query.



getMaxClauseCount
public static int getMaxClauseCount()(Code)
Return the maximum number of clauses permitted, 1024 by default. Attempts to add more than the permitted number of clauses cause TooManyClauses to be thrown.
See Also:   BooleanQuery.setMaxClauseCount(int)



getMinimumNumberShouldMatch
public int getMinimumNumberShouldMatch()(Code)
Gets the minimum number of the optional BooleanClauses which must be satisifed.



getSimilarity
public Similarity getSimilarity(Searcher searcher)(Code)



getUseScorer14
public static boolean getUseScorer14()(Code)
BooleanQuery.getAllowDocsOutOfOrder()



hashCode
public int hashCode()(Code)
Returns a hash code value for this object.



isCoordDisabled
public boolean isCoordDisabled()(Code)
Returns true iff Similarity.coord(intint) is disabled in scoring for this query instance.
See Also:   BooleanQuery.BooleanQuery(boolean)



rewrite
public Query rewrite(IndexReader reader) throws IOException(Code)



setAllowDocsOutOfOrder
public static void setAllowDocsOutOfOrder(boolean allow)(Code)
Expert: Indicates whether hit docs may be collected out of docid order.

Background: although the contract of the Scorer class requires that documents be iterated in order of doc id, this was not true in early versions of Lucene. Many pieces of functionality in the current Lucene code base have undefined behavior if this contract is not upheld, but in some specific simple cases may be faster. (For example: disjunction queries with less than 32 prohibited clauses; This setting has no effect for other queries.)

Specifics: By setting this option to true, calls to HitCollector.collect(intfloat) might be invoked first for docid N and only later for docid N-1. Being static, this setting is system wide.




setMaxClauseCount
public static void setMaxClauseCount(int maxClauseCount)(Code)
Set the maximum number of clauses permitted per BooleanQuery. Default value is 1024.

TermQuery clauses are generated from for example prefix queries and fuzzy queries. Each TermQuery needs some buffer space during search, so this parameter indirectly controls the maximum buffer requirements for query search.

When this parameter becomes a bottleneck for a Query one can use a Filter. For example instead of a RangeQuery one can use a RangeFilter .

Normally the buffers are allocated by the JVM. When using for example org.apache.lucene.store.MMapDirectory the buffering is left to the operating system.




setMinimumNumberShouldMatch
public void setMinimumNumberShouldMatch(int min)(Code)
Specifies a minimum number of the optional BooleanClauses which must be satisfied.

By default no optional clauses are necessary for a match (unless there are no required clauses). If this method is used, then the specified number of clauses is required.

Use of this method is totally independent of specifying that any specific clauses are required (or prohibited). This number will only be compared against the number of matching optional clauses.

EXPERT NOTE: Using this method may force collecting docs in order, regardless of whether setAllowDocsOutOfOrder(true) has been called.


Parameters:
  min - the number of optional clauses that must match
See Also:   BooleanQuery.setAllowDocsOutOfOrder



setUseScorer14
public static void setUseScorer14(boolean use14)(Code)
BooleanQuery.setAllowDocsOutOfOrder(boolean)



toString
public String toString(String field)(Code)
Prints a user-readable version of this query.



Methods inherited from org.apache.lucene.search.Query
public Object clone()(Code)(Java Doc)
public Query combine(Query[] queries)(Code)(Java Doc)
protected Weight createWeight(Searcher searcher) throws IOException(Code)(Java Doc)
public void extractTerms(Set terms)(Code)(Java Doc)
public float getBoost()(Code)(Java Doc)
public Similarity getSimilarity(Searcher searcher)(Code)(Java Doc)
public static Query mergeBooleanQueries(Query[] queries)(Code)(Java Doc)
public Query rewrite(IndexReader reader) throws IOException(Code)(Java Doc)
public void setBoost(float b)(Code)(Java Doc)
abstract public String toString(String field)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public Weight weight(Searcher searcher) throws IOException(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.