Package com.atlassian.jira.search.jql
Class TermQueryFactory
java.lang.Object
com.atlassian.jira.search.jql.TermQueryFactory
This class is used to generate clauses to be added to boolean queries.
Jira uses two custom fields to keep track of what fields are "visible" (to JQL) in a document,
and what fields have missing value.
Since fields with missing values are not indexed, we keep the custom field 'nonemptyfieldids' up to date with all the field names in that document which don't have a value assigned to them. This is used for example in queries such as "value IS empty".
- Since:
- 10.4
-
Method Summary
Modifier and TypeMethodDescriptionstatic QueryemptyQuery(String fieldName) static QuerynonEmptyQuery(String fieldName) static QueryvisibilityQuery(String fieldName) static QuerywrapWithVisibilityQuery(String fieldName, Query query) a utility method to wrap a query with a visibility query
-
Method Details
-
visibilityQuery
- Parameters:
fieldName- the index field to be visible- Returns:
- the term query
visiblefieldids:fieldName
-
wrapWithVisibilityQuery
a utility method to wrap a query with a visibility query- Parameters:
fieldName- the index field to be visiblequery- the query to be wrapped- Returns:
- a boolean query which includes the visibility query and the input query
-
nonEmptyQuery
- Parameters:
fieldName- the index field to be non-empty- Returns:
- the term query
nonemptyfieldids:fieldName
-
emptyQuery
- Parameters:
fieldName- the index field to be empty- Returns:
- the boolean query which includes the visibility query and the negative non-empty query
-