Class QueryVisitor

java.lang.Object
com.atlassian.jira.jql.query.QueryVisitor

@Deprecated(since="10.7", forRemoval=true) @InjectableComponent public class QueryVisitor extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
This class is deprecated and will be removed in Jira 11.0. Use QueryVisitor instead.
Used to generate the Lucene query from a Query. This visits the nodes of the tree and creates a lucene query based on its structure. Users of this class should only call createQuery(com.atlassian.query.clause.Clause, com.atlassian.jira.jql.query.QueryCreationContext) and not use the visitor directly as the query in a QueryFactoryResult may not be valid.
Since:
v4.0
  • Field Details

  • Constructor Details

  • Method Details

    • createQuery

      public org.apache.lucene.search.Query createQuery(Clause clause, QueryCreationContext queryCreationContext)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a lucene query for the passed clause.

      NOTE: The query generated by this method will probably not run in Lucene even though it is correct. Lucene has some quirks when dealing with negative queries. Lucene will not search for negative queries, it will only filter the results from a positive query (e.g. +project:monkey -status:blocker will work while -status:blocker will not).

      NOTE: This visitor will push all instances of the NotClause out of the tree by using the DeMorgansVisitor so that the terminal clauses will handle all the negation logic and the visitor does not need to deal with NOT's.

      Parameters:
      clause - the clause to process.
      Returns:
      the generated lucene query.
    • createContextAwareQueryVisitor

      protected ContextAwareQueryVisitor createContextAwareQueryVisitor(QueryCreationContext queryCreationContext, Clause clause)
      Deprecated, for removal: This API element is subject to removal in a future version.