lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim...@apache.org
Subject svn commit: r894180 - in /lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext: ExtendableQueryParser.java ExtensionQuery.java
Date Mon, 28 Dec 2009 14:27:14 GMT
Author: simonw
Date: Mon Dec 28 14:27:14 2009
New Revision: 894180

URL: http://svn.apache.org/viewvc?rev=894180&view=rev
Log:
LUCENE-2162: Allow ExtendableQueryParser extensions accessing the toplevel parser and its
properties

Modified:
    lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtendableQueryParser.java
    lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtensionQuery.java

Modified: lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtendableQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtendableQueryParser.java?rev=894180&r1=894179&r2=894180&view=diff
==============================================================================
--- lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtendableQueryParser.java
(original)
+++ lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtendableQueryParser.java
Mon Dec 28 14:27:14 2009
@@ -133,7 +133,7 @@
     final ParserExtension extension = this.extensions
         .getExtension(splitExtensionField.cud);
     if (extension != null) {
-      return extension.parse(new ExtensionQuery(splitExtensionField.cur,
+      return extension.parse(new ExtensionQuery(this, splitExtensionField.cur,
           queryText));
     }
     return super.getFieldQuery(field, queryText);

Modified: lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtensionQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtensionQuery.java?rev=894180&r1=894179&r2=894180&view=diff
==============================================================================
--- lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtensionQuery.java
(original)
+++ lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/queryParser/ext/ExtensionQuery.java
Mon Dec 28 14:27:14 2009
@@ -1,5 +1,7 @@
 package org.apache.lucene.queryParser.ext;
 
+import org.apache.lucene.queryParser.QueryParser;
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -29,6 +31,7 @@
 
   private final String field;
   private final String rawQueryString;
+  private final QueryParser topLevelParser;
 
   /**
    * Creates a new {@link ExtensionQuery}
@@ -38,9 +41,10 @@
    * @param rawQueryString
    *          the raw extension query string
    */
-  public ExtensionQuery(String field, String rawQueryString) {
+  public ExtensionQuery(QueryParser topLevelParser, String field, String rawQueryString)
{
     this.field = field;
     this.rawQueryString = rawQueryString;
+    this.topLevelParser = topLevelParser;
   }
 
   /**
@@ -60,4 +64,12 @@
   public String getRawQueryString() {
     return rawQueryString;
   }
+  
+  /**
+   * Returns the top level parser which created this {@link ExtensionQuery} 
+   * @return the top level parser which created this {@link ExtensionQuery}
+   */
+  public QueryParser getTopLevelParser() {
+    return topLevelParser;
+  }
 }



Mime
View raw message