Java Doc for CompassQueryBuilder.java in  » Search-Engine » compass-2.0 » org » compass » core » 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 » compass 2.0 » org.compass.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.compass.core.CompassQueryBuilder

All known Subclasses:   org.compass.core.impl.DefaultCompassQueryBuilder,
CompassQueryBuilder
public interface CompassQueryBuilder (Code)

The query builder is used to construct CompassQuery programmatically. Simple queries, like CompassQueryBuilder.le(String,Object) , will generate a CompassQuery . More complex ones, will return their respective builder to continue and bulid them (like CompassQueryBuilder.multiPhrase(String) ). Combining CompassQuery s can be done using the CompassQueryBuilder.bool() operation.

An example of building a query using the query builder:

 CompassQueryBuilder queryBuilder = session.createQueryBuilder();
 queryBuilder.bool().addMust(queryBuilder.eq("name", "jack")).addMust(queryBuilder.lt("birthdate", "19500101"))
 .toQuery().hits();
 

author:
   kimchy

Inner Class :public static interface ToCompassQuery
Inner Class :public static interface CompassBooleanQueryBuilder extends ToCompassQuery
Inner Class :public static interface CompassMultiPhraseQueryBuilder extends ToCompassQuery
Inner Class :public static interface CompassQueryStringBuilder extends ToCompassQuery
Inner Class :public static interface CompassMultiPropertyQueryStringBuilder extends ToCompassQuery
Inner Class :public static interface CompassQuerySpanNearBuilder
Inner Class :public static interface CompassQuerySpanOrBuilder
Inner Class :public static interface CompassMoreLikeThisQuery extends ToCompassQuery



Method Summary
 CompassQueryalias(String aliasValue)
     Returns a query that exactly match the given alias.
Parameters:
  aliasValue - The alias value to match to.
 CompassQuerybetween(String name, Object low, Object high, boolean inclusive, boolean constantScore)
    

Creates a query where the resource property is between the given values.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The resource property name
Parameters:
  low - The low value limit
Parameters:
  high - The high value limit
Parameters:
  inclusive - If the values are inclusive or exclusive.
Parameters:
  constantScore - If the query will affect the score of the results.

 CompassQuerybetween(String name, Object low, Object high, boolean inclusive)
    

Creates a query where the resource property is between the given values.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The resource property name
Parameters:
  low - The low value limit
Parameters:
  high - The high value limit
Parameters:
  inclusive - If the values are inclusive or exclusive.

 CompassBooleanQueryBuilderbool()
     Constructs a boolean query builder.
 CompassBooleanQueryBuilderbool(boolean disableCoord)
     Constructs a boolean query builder, with coord disabled.
 CompassQueryfuzzy(String name, String value)
    

Creates a fuzzy query for the given resource property and the value.

 CompassQueryfuzzy(String name, String value, float minimumSimilarity)
    

Creates a fuzzy query for the given resource property and the value.

 CompassQueryfuzzy(String name, String value, float minimumSimilarity, int prefixLength)
    

Creates a fuzzy query for the given resource property and the value.

 CompassQueryge(String name, Object value)
    

Creates a query where the resource property is greater or equal (>=) to the given value.

 CompassQuerygt(String name, Object value)
    

Creates a query where the resource property is greater than (>) to the given value.

 CompassQueryle(String name, Object value)
    

Creates a query where the resource property is less or equal (<=) to the given value.

 CompassQuerylt(String name, Object value)
    

Creates a query where the resource property is less than (<) the given value.

 CompassQuerymatchAll()
     Creates a query that match all documents.
 CompassMoreLikeThisQuerymoreLikeThis(String alias, Serializable id)
     Constructs a more like this query.
 CompassMoreLikeThisQuerymoreLikeThis(Reader reader)
     Constructs a more like this query to find hits that are similar to the give text represented by the reader.
 CompassMultiPhraseQueryBuildermultiPhrase(String name)
     Constructs a multi phrase query builder for the given resource property / meta-data name.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The name of the resource property / meta-data.

 CompassMultiPropertyQueryStringBuildermultiPropertyQueryString(String queryString)
     Constructs a multi property query string builder, allowing to execute query strings against several resource property names.
Parameters:
  queryString - The query string (i.e.
 CompassQuerypolyAlias(String aliasValue)
     Returns a query that match the given alias or any extedning aliases.
Parameters:
  aliasValue - The alias value to match to or any extending aliases.
 CompassQueryprefix(String name, String prefix)
    

Creates a query where the resource property values starts with the given prefix.

 CompassQueryStringBuilderqueryString(String queryString)
     Constructs a query string query builder.
Parameters:
  queryString - The query string (i.e.
 CompassSpanQueryspanEq(String name, Object value)
    

Creates a span query where the resource property must match the given value.

 CompassSpanQueryspanFirst(String name, Object value, int end)
    

Creates a span query where the span occur within the first end positions.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The name
Parameters:
  value - The value
Parameters:
  end - The limit on the position from the start.

 CompassSpanQueryspanFirst(CompassSpanQuery spanQuery, int end)
    

Creates a span query.
Parameters:
  end - The limit on the position from the start.

 CompassQuerySpanNearBuilderspanNear(String name)
    

Constructs a span near query builder.

 CompassSpanQueryspanNot(CompassSpanQuery include, CompassSpanQuery exclude)
    

Creates a span query that excludes matches where one org.compass.core.CompassQuery.CompassSpanQuery overlaps with another.

Construct a span query matching spans from include which have no overlap with spans from exclude.
Parameters:
  include - The span query to include.
Parameters:
  exclude - The span query to exclude.

 CompassQuerySpanOrBuilderspanOr()
     Constructs a span or query builder.
 CompassQueryterm(String name, Object value)
    

Creates a query where the resource property must have the given value. Note, that the value itself will not be analyzed, but the text that was indexed might have been (if indexed).

 CompassQuerywildcard(String name, String wildcard)
     Creates a query where the resource property values match the given wildcard.



Method Detail
alias
CompassQuery alias(String aliasValue)(Code)
Returns a query that exactly match the given alias.
Parameters:
  aliasValue - The alias value to match to. The generated query.



between
CompassQuery between(String name, Object low, Object high, boolean inclusive, boolean constantScore)(Code)

Creates a query where the resource property is between the given values.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The resource property name
Parameters:
  low - The low value limit
Parameters:
  high - The high value limit
Parameters:
  inclusive - If the values are inclusive or exclusive.
Parameters:
  constantScore - If the query will affect the score of the results. With all other range queriesit will default to true. The generated query




between
CompassQuery between(String name, Object low, Object high, boolean inclusive)(Code)

Creates a query where the resource property is between the given values.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The resource property name
Parameters:
  low - The low value limit
Parameters:
  high - The high value limit
Parameters:
  inclusive - If the values are inclusive or exclusive. The generated query




bool
CompassBooleanQueryBuilder bool()(Code)
Constructs a boolean query builder.



bool
CompassBooleanQueryBuilder bool(boolean disableCoord)(Code)
Constructs a boolean query builder, with coord disabled.



fuzzy
CompassQuery fuzzy(String name, String value)(Code)

Creates a fuzzy query for the given resource property and the value. The similiarity measurement is based on the Levenshtein (edit distance) algorithm. The minimumSimilarity defaults to 0.5 and prefixLength defaults to 0.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The name
Parameters:
  value - The value The generated query




fuzzy
CompassQuery fuzzy(String name, String value, float minimumSimilarity)(Code)

Creates a fuzzy query for the given resource property and the value. The similiarity measurement is based on the Levenshtein (edit distance) algorithm. The prefixLength defaults to 0.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The name
Parameters:
  value - The value
Parameters:
  minimumSimilarity - The minimum similarity, a value between 0.0 and 1.0 The generated query




fuzzy
CompassQuery fuzzy(String name, String value, float minimumSimilarity, int prefixLength)(Code)

Creates a fuzzy query for the given resource property and the value. The similiarity measurement is based on the Levenshtein (edit distance) algorithm.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The name
Parameters:
  value - The value
Parameters:
  minimumSimilarity - The minimum similarity, a value between 0.0 and 1.0
Parameters:
  prefixLength - The length of common (non-fuzzy) prefix The generated query




ge
CompassQuery ge(String name, Object value)(Code)

Creates a query where the resource property is greater or equal (>=) to the given value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The resource property name
Parameters:
  value - The low limit value The generated query




gt
CompassQuery gt(String name, Object value)(Code)

Creates a query where the resource property is greater than (>) to the given value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The resource property name
Parameters:
  value - The low limit value The generated query




le
CompassQuery le(String name, Object value)(Code)

Creates a query where the resource property is less or equal (<=) to the given value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The resource property name
Parameters:
  value - The high limit value The generated query




lt
CompassQuery lt(String name, Object value)(Code)

Creates a query where the resource property is less than (<) the given value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The resource property name
Parameters:
  value - The high limit value The generated query




matchAll
CompassQuery matchAll()(Code)
Creates a query that match all documents. The generated query



moreLikeThis
CompassMoreLikeThisQuery moreLikeThis(String alias, Serializable id)(Code)
Constructs a more like this query. The id can be an object of the class (with the id attributes set), an array of id objects, or the actual id object. Throws an exception if the resource is not found.



moreLikeThis
CompassMoreLikeThisQuery moreLikeThis(Reader reader)(Code)
Constructs a more like this query to find hits that are similar to the give text represented by the reader.



multiPhrase
CompassMultiPhraseQueryBuilder multiPhrase(String name)(Code)
Constructs a multi phrase query builder for the given resource property / meta-data name.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The name of the resource property / meta-data. The multi phrase query builder.




multiPropertyQueryString
CompassMultiPropertyQueryStringBuilder multiPropertyQueryString(String queryString)(Code)
Constructs a multi property query string builder, allowing to execute query strings against several resource property names.
Parameters:
  queryString - The query string (i.e. +jack +london) The multi property string query builder.



polyAlias
CompassQuery polyAlias(String aliasValue)(Code)
Returns a query that match the given alias or any extedning aliases.
Parameters:
  aliasValue - The alias value to match to or any extending aliases. The generated query.



prefix
CompassQuery prefix(String name, String prefix)(Code)

Creates a query where the resource property values starts with the given prefix.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - the resource property name
Parameters:
  prefix - The prefix value The generated query




queryString
CompassQueryStringBuilder queryString(String queryString)(Code)
Constructs a query string query builder.
Parameters:
  queryString - The query string (i.e. +jack +london). The query string query builder.



spanEq
CompassSpanQuery spanEq(String name, Object value)(Code)

Creates a span query where the resource property must match the given value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The name
Parameters:
  value - The value The span query




spanFirst
CompassSpanQuery spanFirst(String name, Object value, int end)(Code)

Creates a span query where the span occur within the first end positions.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The name
Parameters:
  value - The value
Parameters:
  end - The limit on the position from the start. The span query




spanFirst
CompassSpanQuery spanFirst(CompassSpanQuery spanQuery, int end)(Code)

Creates a span query.
Parameters:
  end - The limit on the position from the start. The span query




spanNear
CompassQuerySpanNearBuilder spanNear(String name)(Code)

Constructs a span near query builder.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The name The span near query builder




spanNot
CompassSpanQuery spanNot(CompassSpanQuery include, CompassSpanQuery exclude)(Code)

Creates a span query that excludes matches where one org.compass.core.CompassQuery.CompassSpanQuery overlaps with another.

Construct a span query matching spans from include which have no overlap with spans from exclude.
Parameters:
  include - The span query to include.
Parameters:
  exclude - The span query to exclude. The span query




spanOr
CompassQuerySpanOrBuilder spanOr()(Code)
Constructs a span or query builder. The span query builder



term
CompassQuery term(String name, Object value)(Code)

Creates a query where the resource property must have the given value. Note, that the value itself will not be analyzed, but the text that was indexed might have been (if indexed). The search is case sensative.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  name - The resource property name
Parameters:
  value - The value that must match The generated query




wildcard
CompassQuery wildcard(String name, String wildcard)(Code)
Creates a query where the resource property values match the given wildcard. Supported wildcards are *, which matches any character sequence (including the empty one), and ?, which matches any single character. Note this query can be slow, as it needs to iterate over many terms. In order to prevent extremely slow WildcardQueries, a Wildcard term should not start with one of the wildcards * or ?.
Parameters:
  name - The name
Parameters:
  wildcard - The wildcard expression The generated query



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