/** * Creates a new query instance from a query string. * * @param sessionContext component context of the current session * @param index the search index. * @param propReg the property type registry. * @param statement the query statement. * @param language the syntax of the query statement. * @param factory the query node factory. * @throws InvalidQueryException if the query statement is invalid according * to the specified <code>language</code>. */ public QueryImpl( SessionContext sessionContext, SearchIndex index, PropertyTypeRegistry propReg, String statement, String language, QueryNodeFactory factory) throws InvalidQueryException { super(sessionContext, index, propReg); // parse query according to language // build query tree using the passed factory this.root = QueryParser.parse( statement, language, sessionContext, factory); }
/** * Creates a new query instance from a query string. * * @param sessionContext component context of the current session * @param index the search index. * @param propReg the property type registry. * @param statement the query statement. * @param language the syntax of the query statement. * @param factory the query node factory. * @throws InvalidQueryException if the query statement is invalid according * to the specified <code>language</code>. */ public QueryImpl( SessionContext sessionContext, SearchIndex index, PropertyTypeRegistry propReg, String statement, String language, QueryNodeFactory factory) throws InvalidQueryException { super(sessionContext, index, propReg); // parse query according to language // build query tree using the passed factory this.root = QueryParser.parse( statement, language, sessionContext, factory); }
public Result query(String statement, ContextImpl context) throws InvalidQueryException, RepositoryException { QueryRootNode root = org.apache.jackrabbit.spi.commons.query.QueryParser.parse(statement, "xpath", context.session, getQueryNodeFactory()); org.apache.lucene.search.Query query = LuceneQueryBuilder.createQuery(root, context.session, getContext()
if (javax.jcr.query.Query.XPATH.equals(language)) { try { QueryRootNode root = org.apache.jackrabbit.spi.commons.query.QueryParser.parse(statement, "xpath", context.session, getQueryNodeFactory()); org.apache.lucene.search.Query query = LuceneQueryBuilder.createQuery(root, context.session,