You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2012/09/21 19:22:27 UTC
svn commit: r1388574 [28/45] - in /lucene/dev/branches/LUCENE-2878: ./
dev-tools/ dev-tools/eclipse/ dev-tools/eclipse/dot.settings/
dev-tools/idea/ dev-tools/idea/.idea/ dev-tools/idea/.idea/libraries/
dev-tools/idea/lucene/ dev-tools/idea/lucene/anal...
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CorePlusExtensionsParser.java Fri Sep 21 17:21:34 2012
@@ -22,7 +22,9 @@ import org.apache.lucene.queryparser.xml
*/
/**
- *
+ * Assembles a QueryBuilder which uses Query objects from
+ * Lucene's <code>sandbox</code> and <code>queries</code>
+ * modules in addition to core queries.
*/
public class CorePlusExtensionsParser extends CoreParser {
@@ -56,6 +58,6 @@ public class CorePlusExtensionsParser ex
queryFactory.addBuilder("LikeThisQuery", new LikeThisQueryBuilder(analyzer, fields));
queryFactory.addBuilder("BoostingQuery", new BoostingQueryBuilder(queryFactory));
queryFactory.addBuilder("FuzzyLikeThisQuery", new FuzzyLikeThisQueryBuilder(analyzer));
-
- }
+
+ }
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/DOMUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/DOMUtils.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/DOMUtils.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/DOMUtils.java Fri Sep 21 17:21:34 2012
@@ -26,7 +26,7 @@ import java.io.Reader;
*/
/**
- *
+ * Helper methods for parsing XML
*/
public class DOMUtils {
@@ -212,7 +212,7 @@ public class DOMUtils {
}
return doc;
- }
+ }
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/FilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/FilterBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/FilterBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/FilterBuilder.java Fri Sep 21 17:21:34 2012
@@ -23,9 +23,9 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Interface for building {@link Filter}s
*/
public interface FilterBuilder {
- public Filter getFilter(Element e) throws ParserException;
+ public Filter getFilter(Element e) throws ParserException;
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/FilterBuilderFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/FilterBuilderFactory.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/FilterBuilderFactory.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/FilterBuilderFactory.java Fri Sep 21 17:21:34 2012
@@ -25,7 +25,7 @@ import java.util.HashMap;
*/
/**
- *
+ * Factory for {@link FilterBuilder}
*/
public class FilterBuilderFactory implements FilterBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/ParserException.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/ParserException.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/ParserException.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/ParserException.java Fri Sep 21 17:21:34 2012
@@ -20,36 +20,37 @@ package org.apache.lucene.queryparser.xm
*/
/**
- *
+ * Thrown when the xml queryparser encounters
+ * invalid syntax/configuration.
*/
public class ParserException extends Exception {
- /**
- *
- */
- public ParserException() {
- super();
- }
+ /**
+ *
+ */
+ public ParserException() {
+ super();
+ }
- /**
- * @param message
- */
- public ParserException(String message) {
- super(message);
- }
+ /**
+ * @param message
+ */
+ public ParserException(String message) {
+ super(message);
+ }
- /**
- * @param message
- * @param cause
- */
- public ParserException(String message, Throwable cause) {
- super(message, cause);
- }
+ /**
+ * @param message
+ * @param cause
+ */
+ public ParserException(String message, Throwable cause) {
+ super(message, cause);
+ }
- /**
- * @param cause
- */
- public ParserException(Throwable cause) {
- super(cause);
- }
+ /**
+ * @param cause
+ */
+ public ParserException(Throwable cause) {
+ super(cause);
+ }
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -23,6 +23,6 @@ import org.w3c.dom.Element;
* expected to be thread-safe so that they can be used to simultaneously parse multiple XML documents.
*/
public interface QueryBuilder {
-
- public Query getQuery(Element e) throws ParserException;
+
+ public Query getQuery(Element e) throws ParserException;
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryBuilderFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryBuilderFactory.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryBuilderFactory.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryBuilderFactory.java Fri Sep 21 17:21:34 2012
@@ -25,7 +25,7 @@ import java.util.HashMap;
*/
/**
- *
+ * Factory for {@link QueryBuilder}
*/
public class QueryBuilderFactory implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java Fri Sep 21 17:21:34 2012
@@ -199,5 +199,5 @@ public class QueryTemplateManager {
org.w3c.dom.Document xslDoc = builder.parse(xslIs);
DOMSource ds = new DOMSource(xslDoc);
return tFactory.newTemplates(ds);
- }
+ }
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BooleanFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BooleanFilterBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BooleanFilterBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BooleanFilterBuilder.java Fri Sep 21 17:21:34 2012
@@ -32,7 +32,7 @@ import org.w3c.dom.NodeList;
*/
/**
- *
+ * Builder for {@link BooleanFilter}
*/
public class BooleanFilterBuilder implements FilterBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BooleanQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BooleanQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BooleanQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BooleanQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -30,7 +30,7 @@ import org.w3c.dom.NodeList;
*/
/**
- *
+ * Builder for {@link BooleanQuery}
*/
public class BooleanQueryBuilder implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -24,7 +24,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link BoostingQuery}
*/
public class BoostingQueryBuilder implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingTermBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingTermBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingTermBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/BoostingTermBuilder.java Fri Sep 21 17:21:34 2012
@@ -26,7 +26,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link PayloadTermQuery}
*/
public class BoostingTermBuilder extends SpanBuilderBase {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/CachedFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/CachedFilterBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/CachedFilterBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/CachedFilterBuilder.java Fri Sep 21 17:21:34 2012
@@ -32,10 +32,10 @@ import java.util.Map;
* Filters are cached in an LRU Cache keyed on the contained query or filter object. Using this will
* speed up overall performance for repeated uses of the same expensive query/filter. The sorts of
* queries/filters likely to benefit from caching need not necessarily be complex - e.g. simple
- * TermQuerys with a large DF (document frequency) can be expensive on large indexes.
- * A good example of this might be a term query on a field with only 2 possible values -
+ * TermQuerys with a large DF (document frequency) can be expensive on large indexes.
+ * A good example of this might be a term query on a field with only 2 possible values -
* "true" or "false". In a large index, querying or filtering on this field requires reading
- * millions of document ids from disk which can more usefully be cached as a filter bitset.
+ * millions of document ids from disk which can more usefully be cached as a filter bitset.
* <p/>
* For Queries/Filters to be cached and reused the object must implement hashcode and
* equals methods correctly so that duplicate queries/filters can be detected in the cache.
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/ConstantScoreQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/ConstantScoreQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/ConstantScoreQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/ConstantScoreQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -25,7 +25,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link ConstantScoreQuery}
*/
public class ConstantScoreQueryBuilder implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/DisjunctionMaxQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/DisjunctionMaxQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/DisjunctionMaxQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/DisjunctionMaxQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -26,7 +26,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
- * Build a DisjunctionMaxQuery.
+ * Builder for {@link DisjunctionMaxQuery}
*/
public class DisjunctionMaxQueryBuilder implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/DuplicateFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/DuplicateFilterBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/DuplicateFilterBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/DuplicateFilterBuilder.java Fri Sep 21 17:21:34 2012
@@ -28,7 +28,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link DuplicateFilter}
*/
public class DuplicateFilterBuilder implements FilterBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FilteredQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FilteredQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FilteredQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FilteredQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -30,7 +30,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link FilteredQuery}
*/
public class FilteredQueryBuilder implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FuzzyLikeThisQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FuzzyLikeThisQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FuzzyLikeThisQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/FuzzyLikeThisQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -28,7 +28,7 @@ import org.w3c.dom.NodeList;
*/
/**
- *
+ * Builder for {@link FuzzyLikeThisQuery}
*/
public class FuzzyLikeThisQueryBuilder implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/LikeThisQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/LikeThisQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/LikeThisQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/LikeThisQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -35,7 +35,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link MoreLikeThisQuery}
*/
public class LikeThisQueryBuilder implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/MatchAllDocsQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/MatchAllDocsQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/MatchAllDocsQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/MatchAllDocsQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -23,7 +23,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link MatchAllDocsQuery}
*/
public class MatchAllDocsQueryBuilder implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/NumericRangeFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/NumericRangeFilterBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/NumericRangeFilterBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/NumericRangeFilterBuilder.java Fri Sep 21 17:21:34 2012
@@ -158,7 +158,7 @@ public class NumericRangeFilterBuilder i
@Override
public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
return null;
- }
+ }
- }
+ }
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/RangeFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/RangeFilterBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/RangeFilterBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/RangeFilterBuilder.java Fri Sep 21 17:21:34 2012
@@ -28,7 +28,7 @@ import org.w3c.dom.Element;
/**
- *
+ * Builder for {@link TermRangeFilter}
*/
public class RangeFilterBuilder implements FilterBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanBuilderBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanBuilderBase.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanBuilderBase.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanBuilderBase.java Fri Sep 21 17:21:34 2012
@@ -1,6 +1,7 @@
package org.apache.lucene.queryparser.xml.builders;
import org.apache.lucene.search.Query;
+import org.apache.lucene.search.spans.SpanQuery; // javadocs
import org.apache.lucene.queryparser.xml.ParserException;
import org.w3c.dom.Element;
/*
@@ -21,7 +22,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Base class for building {@link SpanQuery}s
*/
public abstract class SpanBuilderBase implements SpanQueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanFirstBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanFirstBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanFirstBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanFirstBuilder.java Fri Sep 21 17:21:34 2012
@@ -23,7 +23,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link SpanFirstQuery}
*/
public class SpanFirstBuilder extends SpanBuilderBase {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanNearBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanNearBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanNearBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanNearBuilder.java Fri Sep 21 17:21:34 2012
@@ -27,7 +27,7 @@ import java.util.List;
*/
/**
- *
+ * Builder for {@link SpanNearQuery}
*/
public class SpanNearBuilder extends SpanBuilderBase {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanNotBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanNotBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanNotBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanNotBuilder.java Fri Sep 21 17:21:34 2012
@@ -23,7 +23,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link SpanNotQuery}
*/
public class SpanNotBuilder extends SpanBuilderBase {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanOrBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanOrBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanOrBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanOrBuilder.java Fri Sep 21 17:21:34 2012
@@ -27,7 +27,7 @@ import java.util.List;
*/
/**
- *
+ * Builder for {@link SpanOrQuery}
*/
public class SpanOrBuilder extends SpanBuilderBase {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanOrTermsBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanOrTermsBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanOrTermsBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanOrTermsBuilder.java Fri Sep 21 17:21:34 2012
@@ -34,7 +34,7 @@ import java.util.List;
*/
/**
- *
+ * Builder that analyzes the text into a {@link SpanOrQuery}
*/
public class SpanOrTermsBuilder extends SpanBuilderBase {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -20,7 +20,10 @@ import org.apache.lucene.queryparser.xml
import org.apache.lucene.queryparser.xml.QueryBuilder;
import org.w3c.dom.Element;
+/**
+ * Interface for retrieving a {@link SpanQuery}.
+ */
public interface SpanQueryBuilder extends QueryBuilder {
-
- public SpanQuery getSpanQuery(Element e) throws ParserException;
+
+ public SpanQuery getSpanQuery(Element e) throws ParserException;
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanQueryBuilderFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanQueryBuilderFactory.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanQueryBuilderFactory.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanQueryBuilderFactory.java Fri Sep 21 17:21:34 2012
@@ -25,7 +25,7 @@ import java.util.Map;
*/
/**
- *
+ * Factory for {@link SpanQueryBuilder}s
*/
public class SpanQueryBuilderFactory implements SpanQueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanTermBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanTermBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanTermBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/SpanTermBuilder.java Fri Sep 21 17:21:34 2012
@@ -24,7 +24,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link SpanTermQuery}
*/
public class SpanTermBuilder extends SpanBuilderBase {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/TermQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/TermQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/TermQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/TermQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -25,7 +25,7 @@ import org.w3c.dom.Element;
*/
/**
- *
+ * Builder for {@link TermQuery}
*/
public class TermQueryBuilder implements QueryBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/TermsFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/TermsFilterBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/TermsFilterBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/TermsFilterBuilder.java Fri Sep 21 17:21:34 2012
@@ -33,7 +33,7 @@ import java.io.StringReader;
*/
/**
- *
+ * Builder for {@link TermsFilter}
*/
public class TermsFilterBuilder implements FilterBuilder {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/UserInputQueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/UserInputQueryBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/UserInputQueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/builders/UserInputQueryBuilder.java Fri Sep 21 17:21:34 2012
@@ -88,6 +88,6 @@ public class UserInputQueryBuilder imple
*/
protected QueryParser createQueryParser(String fieldName, Analyzer analyzer) {
return new QueryParser(Version.LUCENE_CURRENT, fieldName, analyzer);
- }
+ }
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestMultiPhraseQueryParsing.java Fri Sep 21 17:21:34 2012
@@ -81,8 +81,7 @@ public class TestMultiPhraseQueryParsing
}
@Override
- public void setReader(Reader reader) throws IOException {
- super.setReader(reader);
+ public void reset() throws IOException {
this.upto = 0;
this.lastPos = 0;
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/complexPhrase/TestComplexPhraseQuery.java Fri Sep 21 17:21:34 2012
@@ -26,6 +26,7 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.StoredDocument;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
@@ -100,7 +101,7 @@ public class TestComplexPhraseQuery exte
TopDocs td = searcher.search(q, 10);
ScoreDoc[] sd = td.scoreDocs;
for (int i = 0; i < sd.length; i++) {
- Document doc = searcher.doc(sd[i].doc);
+ StoredDocument doc = searcher.doc(sd[i].doc);
String id = doc.get("id");
assertTrue(qString + "matched doc#" + id + " not expected", expecteds
.contains(id));
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/standard/TestNumericQueryParser.java Fri Sep 21 17:21:34 2012
@@ -223,7 +223,7 @@ public class TestNumericQueryParser exte
field = new DoubleField(type.name(), 0.0, ft);
break;
default:
- assert false;
+ fail();
field = null;
}
numericFieldMap.put(type.name(), field);
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestParser.java Fri Sep 21 17:21:34 2012
@@ -28,6 +28,7 @@ import org.apache.lucene.index.AtomicRea
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.StoredDocument;
import org.apache.lucene.search.DisjunctionMaxQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
@@ -232,7 +233,7 @@ public class TestParser extends LuceneTe
System.out.println("=========" + qType + "============");
ScoreDoc[] scoreDocs = hits.scoreDocs;
for (int i = 0; i < Math.min(numDocs, hits.totalHits); i++) {
- Document ldoc = searcher.doc(scoreDocs[i].doc);
+ StoredDocument ldoc = searcher.doc(scoreDocs[i].doc);
System.out.println("[" + ldoc.get("date") + "]" + ldoc.get("contents"));
}
System.out.println();
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TestQueryTemplateManager.java Fri Sep 21 17:21:34 2012
@@ -89,7 +89,7 @@ public class TestQueryTemplateManager ex
Properties queryFormProperties = getPropsFromString(queryForm);
//Get the required query XSL template for this test
-// Templates template=getTemplate(queryFormProperties.getProperty("template"));
+// Templates template=getTemplate(queryFormProperties.getProperty("template"));
//Transform the queryFormProperties into a Lucene XML query
Document doc = qtm.getQueryAsDOM(queryFormProperties, queryFormProperties.getProperty("template"));
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeFilterBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeFilterBuilder.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeFilterBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/builders/TestNumericRangeFilterBuilder.java Fri Sep 21 17:21:34 2012
@@ -66,7 +66,7 @@ public class TestNumericRangeFilterBuild
try {
AtomicReader reader = new SlowCompositeReaderWrapper(DirectoryReader.open(ramDir));
try {
- assertNull(filter.getDocIdSet(reader.getTopReaderContext(), reader.getLiveDocs()));
+ assertNull(filter.getDocIdSet(reader.getContext(), reader.getLiveDocs()));
}
finally {
reader.close();
Modified: lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/FuzzyLikeThisQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/FuzzyLikeThisQuery.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/FuzzyLikeThisQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/FuzzyLikeThisQuery.java Fri Sep 21 17:21:34 2012
@@ -121,17 +121,17 @@ public class FuzzyLikeThisQuery extends
class FieldVals
{
- String queryString;
- String fieldName;
- float minSimilarity;
- int prefixLength;
- public FieldVals(String name, float similarity, int length, String queryString)
- {
- fieldName = name;
- minSimilarity = similarity;
- prefixLength = length;
- this.queryString = queryString;
- }
+ String queryString;
+ String fieldName;
+ float minSimilarity;
+ int prefixLength;
+ public FieldVals(String name, float similarity, int length, String queryString)
+ {
+ fieldName = name;
+ minSimilarity = similarity;
+ prefixLength = length;
+ this.queryString = queryString;
+ }
@Override
public int hashCode() {
@@ -174,7 +174,7 @@ public class FuzzyLikeThisQuery extends
}
-
+
}
/**
@@ -186,77 +186,72 @@ public class FuzzyLikeThisQuery extends
*/
public void addTerms(String queryString, String fieldName,float minSimilarity, int prefixLength)
{
- fieldVals.add(new FieldVals(fieldName,minSimilarity,prefixLength,queryString));
+ fieldVals.add(new FieldVals(fieldName,minSimilarity,prefixLength,queryString));
}
-
-
- private void addTerms(IndexReader reader,FieldVals f) throws IOException
- {
- if(f.queryString==null) return;
- TokenStream ts=analyzer.tokenStream(f.fieldName, new StringReader(f.queryString));
- CharTermAttribute termAtt = ts.addAttribute(CharTermAttribute.class);
-
- int corpusNumDocs=reader.numDocs();
- HashSet<String> processedTerms=new HashSet<String>();
- ts.reset();
- while (ts.incrementToken())
- {
- String term = termAtt.toString();
- if(!processedTerms.contains(term))
- {
- processedTerms.add(term);
- ScoreTermQueue variantsQ=new ScoreTermQueue(MAX_VARIANTS_PER_TERM); //maxNum variants considered for any one term
- float minScore=0;
- Term startTerm=new Term(f.fieldName, term);
- AttributeSource atts = new AttributeSource();
- MaxNonCompetitiveBoostAttribute maxBoostAtt =
- atts.addAttribute(MaxNonCompetitiveBoostAttribute.class);
- SlowFuzzyTermsEnum fe = new SlowFuzzyTermsEnum(MultiFields.getTerms(reader, startTerm.field()), atts, startTerm, f.minSimilarity, f.prefixLength);
- //store the df so all variants use same idf
- int df = reader.docFreq(startTerm);
- int numVariants=0;
- int totalVariantDocFreqs=0;
- BytesRef possibleMatch;
- BoostAttribute boostAtt =
- fe.attributes().addAttribute(BoostAttribute.class);
- while ((possibleMatch = fe.next()) != null) {
- numVariants++;
- totalVariantDocFreqs+=fe.docFreq();
- float score=boostAtt.getBoost();
- if (variantsQ.size() < MAX_VARIANTS_PER_TERM || score > minScore){
- ScoreTerm st=new ScoreTerm(new Term(startTerm.field(), BytesRef.deepCopyOf(possibleMatch)),score,startTerm);
- variantsQ.insertWithOverflow(st);
- minScore = variantsQ.top().score; // maintain minScore
- }
- maxBoostAtt.setMaxNonCompetitiveBoost(variantsQ.size() >= MAX_VARIANTS_PER_TERM ? minScore : Float.NEGATIVE_INFINITY);
- }
-
- if(numVariants>0)
- {
- int avgDf=totalVariantDocFreqs/numVariants;
- if(df==0)//no direct match we can use as df for all variants
- {
- df=avgDf; //use avg df of all variants
- }
-
- // take the top variants (scored by edit distance) and reset the score
- // to include an IDF factor then add to the global queue for ranking
- // overall top query terms
- int size = variantsQ.size();
- for(int i = 0; i < size; i++)
- {
- ScoreTerm st = variantsQ.pop();
- st.score=(st.score*st.score)*sim.idf(df,corpusNumDocs);
- q.insertWithOverflow(st);
- }
- }
- }
+
+
+ private void addTerms(IndexReader reader, FieldVals f) throws IOException {
+ if (f.queryString == null) return;
+ TokenStream ts = analyzer.tokenStream(f.fieldName, new StringReader(f.queryString));
+ CharTermAttribute termAtt = ts.addAttribute(CharTermAttribute.class);
+
+ int corpusNumDocs = reader.numDocs();
+ HashSet<String> processedTerms = new HashSet<String>();
+ ts.reset();
+ while (ts.incrementToken()) {
+ String term = termAtt.toString();
+ if (!processedTerms.contains(term)) {
+ processedTerms.add(term);
+ ScoreTermQueue variantsQ = new ScoreTermQueue(MAX_VARIANTS_PER_TERM); //maxNum variants considered for any one term
+ float minScore = 0;
+ Term startTerm = new Term(f.fieldName, term);
+ AttributeSource atts = new AttributeSource();
+ MaxNonCompetitiveBoostAttribute maxBoostAtt =
+ atts.addAttribute(MaxNonCompetitiveBoostAttribute.class);
+ SlowFuzzyTermsEnum fe = new SlowFuzzyTermsEnum(MultiFields.getTerms(reader, startTerm.field()), atts, startTerm, f.minSimilarity, f.prefixLength);
+ //store the df so all variants use same idf
+ int df = reader.docFreq(startTerm);
+ int numVariants = 0;
+ int totalVariantDocFreqs = 0;
+ BytesRef possibleMatch;
+ BoostAttribute boostAtt =
+ fe.attributes().addAttribute(BoostAttribute.class);
+ while ((possibleMatch = fe.next()) != null) {
+ numVariants++;
+ totalVariantDocFreqs += fe.docFreq();
+ float score = boostAtt.getBoost();
+ if (variantsQ.size() < MAX_VARIANTS_PER_TERM || score > minScore) {
+ ScoreTerm st = new ScoreTerm(new Term(startTerm.field(), BytesRef.deepCopyOf(possibleMatch)), score, startTerm);
+ variantsQ.insertWithOverflow(st);
+ minScore = variantsQ.top().score; // maintain minScore
+ }
+ maxBoostAtt.setMaxNonCompetitiveBoost(variantsQ.size() >= MAX_VARIANTS_PER_TERM ? minScore : Float.NEGATIVE_INFINITY);
}
- ts.end();
- ts.close();
+
+ if (numVariants > 0) {
+ int avgDf = totalVariantDocFreqs / numVariants;
+ if (df == 0)//no direct match we can use as df for all variants
+ {
+ df = avgDf; //use avg df of all variants
+ }
+
+ // take the top variants (scored by edit distance) and reset the score
+ // to include an IDF factor then add to the global queue for ranking
+ // overall top query terms
+ int size = variantsQ.size();
+ for (int i = 0; i < size; i++) {
+ ScoreTerm st = variantsQ.pop();
+ st.score = (st.score * st.score) * sim.idf(df, corpusNumDocs);
+ q.insertWithOverflow(st);
+ }
+ }
+ }
}
-
- @Override
+ ts.end();
+ ts.close();
+ }
+
+ @Override
public Query rewrite(IndexReader reader) throws IOException
{
if(rewrittenQuery!=null)
@@ -264,12 +259,11 @@ public class FuzzyLikeThisQuery extends
return rewrittenQuery;
}
//load up the list of possible terms
- for (Iterator<FieldVals> iter = fieldVals.iterator(); iter.hasNext();)
- {
- FieldVals f = iter.next();
- addTerms(reader,f);
- }
- //clear the list of fields
+ for (Iterator<FieldVals> iter = fieldVals.iterator(); iter.hasNext(); ) {
+ FieldVals f = iter.next();
+ addTerms(reader, f);
+ }
+ //clear the list of fields
fieldVals.clear();
BooleanQuery bq=new BooleanQuery();
@@ -368,15 +362,15 @@ public class FuzzyLikeThisQuery extends
}
- public boolean isIgnoreTF()
- {
- return ignoreTF;
- }
+ public boolean isIgnoreTF()
+ {
+ return ignoreTF;
+ }
- public void setIgnoreTF(boolean ignoreTF)
- {
- this.ignoreTF = ignoreTF;
- }
+ public void setIgnoreTF(boolean ignoreTF)
+ {
+ this.ignoreTF = ignoreTF;
+ }
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/DuplicateFilterTest.java Fri Sep 21 17:21:34 2012
@@ -87,7 +87,7 @@ public class DuplicateFilterTest extends
ScoreDoc[] hits = searcher.search(tq, df, 1000).scoreDocs;
for (ScoreDoc hit : hits) {
- Document d = searcher.doc(hit.doc);
+ StoredDocument d = searcher.doc(hit.doc);
String url = d.get(KEY_FIELD);
assertFalse("No duplicate urls should be returned", results.contains(url));
results.add(url);
@@ -101,7 +101,7 @@ public class DuplicateFilterTest extends
boolean dupsFound = false;
for (ScoreDoc hit : hits) {
- Document d = searcher.doc(hit.doc);
+ StoredDocument d = searcher.doc(hit.doc);
String url = d.get(KEY_FIELD);
if (!dupsFound)
dupsFound = results.contains(url);
@@ -118,7 +118,7 @@ public class DuplicateFilterTest extends
assertTrue("Filtered searching should have found some matches", hits.length > 0);
for (ScoreDoc hit : hits) {
- Document d = searcher.doc(hit.doc);
+ StoredDocument d = searcher.doc(hit.doc);
String url = d.get(KEY_FIELD);
assertFalse("No duplicate urls should be returned", results.contains(url));
results.add(url);
@@ -132,7 +132,7 @@ public class DuplicateFilterTest extends
ScoreDoc[] hits = searcher.search(tq, df, 1000).scoreDocs;
assertTrue("Filtered searching should have found some matches", hits.length > 0);
for (ScoreDoc hit : hits) {
- Document d = searcher.doc(hit.doc);
+ StoredDocument d = searcher.doc(hit.doc);
String url = d.get(KEY_FIELD);
DocsEnum td = _TestUtil.docs(random(), reader,
KEY_FIELD,
@@ -156,7 +156,7 @@ public class DuplicateFilterTest extends
ScoreDoc[] hits = searcher.search(tq, df, 1000).scoreDocs;
assertTrue("Filtered searching should have found some matches", hits.length > 0);
for (ScoreDoc hit : hits) {
- Document d = searcher.doc(hit.doc);
+ StoredDocument d = searcher.doc(hit.doc);
String url = d.get(KEY_FIELD);
DocsEnum td = _TestUtil.docs(random(), reader,
KEY_FIELD,
Modified: lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/FuzzyLikeThisQueryTest.java Fri Sep 21 17:21:34 2012
@@ -23,6 +23,7 @@ import org.apache.lucene.document.Docume
import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.RandomIndexWriter;
+import org.apache.lucene.index.StoredDocument;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
@@ -88,7 +89,7 @@ public class FuzzyLikeThisQueryTest exte
TopDocs topDocs = searcher.search(flt, 1);
ScoreDoc[] sd = topDocs.scoreDocs;
assertTrue("score docs must match 1 doc", (sd != null) && (sd.length > 0));
- Document doc = searcher.doc(sd[0].doc);
+ StoredDocument doc = searcher.doc(sd[0].doc);
assertEquals("Should match most similar not most rare variant", "2", doc.get("id"));
}
@@ -104,7 +105,7 @@ public class FuzzyLikeThisQueryTest exte
TopDocs topDocs = searcher.search(flt, 1);
ScoreDoc[] sd = topDocs.scoreDocs;
assertTrue("score docs must match 1 doc", (sd != null) && (sd.length > 0));
- Document doc = searcher.doc(sd[0].doc);
+ StoredDocument doc = searcher.doc(sd[0].doc);
assertEquals("Should match most similar when using 2 words", "2", doc.get("id"));
}
@@ -119,7 +120,7 @@ public class FuzzyLikeThisQueryTest exte
TopDocs topDocs = searcher.search(flt, 1);
ScoreDoc[] sd = topDocs.scoreDocs;
assertTrue("score docs must match 1 doc", (sd != null) && (sd.length > 0));
- Document doc = searcher.doc(sd[0].doc);
+ StoredDocument doc = searcher.doc(sd[0].doc);
assertEquals("Should match most similar when using 2 words", "2", doc.get("id"));
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/test/org/apache/lucene/sandbox/queries/TestSlowFuzzyQuery.java Fri Sep 21 17:21:34 2012
@@ -105,7 +105,7 @@ public class TestSlowFuzzyQuery extends
}
// not similar enough:
- query = new SlowFuzzyQuery(new Term("field", "xxxxx"), SlowFuzzyQuery.defaultMinSimilarity, 0);
+ query = new SlowFuzzyQuery(new Term("field", "xxxxx"), SlowFuzzyQuery.defaultMinSimilarity, 0);
hits = searcher.search(query, null, 1000).scoreDocs;
assertEquals(0, hits.length);
query = new SlowFuzzyQuery(new Term("field", "aaccc"), SlowFuzzyQuery.defaultMinSimilarity, 0); // edit distance to "aaaaa" = 3
Modified: lucene/dev/branches/LUCENE-2878/lucene/site/changes/changes2html.pl
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/site/changes/changes2html.pl?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/site/changes/changes2html.pl (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/site/changes/changes2html.pl Fri Sep 21 17:21:34 2012
@@ -25,13 +25,12 @@ use strict;
use warnings;
# JIRA REST API documentation: <http://docs.atlassian.com/jira/REST/latest/>
-my $project_info_url = 'https://issues.apache.org/jira/rest/api/2/project/LUCENE';
+my $project_info_url = 'https://issues.apache.org/jira/rest/api/2/project';
my $jira_url_prefix = 'http://issues.apache.org/jira/browse/';
my $bugzilla_url_prefix = 'http://issues.apache.org/bugzilla/show_bug.cgi?id=';
-my %release_dates = &setup_release_dates;
my $month_regex = &setup_month_regex;
my %month_nums = &setup_month_nums;
-my %bugzilla_jira_map = &setup_bugzilla_jira_map;
+my %lucene_bugzilla_jira_map = &setup_lucene_bugzilla_jira_map;
my $title = undef;
my $release = undef;
my $reldate = undef;
@@ -44,20 +43,35 @@ my @releases = ();
my @lines = <>; # Get all input at once
+my $product = '';
+for my $line (@lines) {
+ ($product) = $line =~ /(Solr|Lucene)/i;
+ if ($product) {
+ $product = uc($product);
+ last;
+ }
+}
+my %release_dates = &setup_release_dates;
+my $in_major_component_versions_section = 0;
+
+
#
# Parse input and build hierarchical release structure in @releases
#
for (my $line_num = 0 ; $line_num <= $#lines ; ++$line_num) {
$_ = $lines[$line_num];
- next unless (/\S/); # Skip blank lines
+ unless (/\S/) { # Skip blank lines
+ $in_major_component_versions_section = 0;
+ next;
+ }
next if (/^\s*\$Id(?::.*)?\$/); # Skip $Id$ lines
+ next if (/^\s{0,4}-{5,}\s*$/); # Skip Solr's section underlines
unless ($title) {
if (/\S/) {
- s/^\s+//; # Trim leading whitespace
+ s/^[^\p{N}\p{L}]*//; # Trim leading non-alphanum chars, including BOM chars, if any
s/\s+$//; # Trim trailing whitespace
}
- s/^[^Ll]*//; # Trim leading BOM characters if exists
$title = $_;
next;
}
@@ -71,8 +85,11 @@ for (my $line_num = 0 ; $line_num <= $#l
($reldate, $relinfo) = get_release_date($release, $relinfo);
$sections = [];
push @releases, [ $release, $reldate, $relinfo, $sections ];
- ($first_relid = lc($release)) =~ s/\s+/_/g if ($#releases == 0);
- ($second_relid = lc($release)) =~ s/\s+/_/g if ($#releases == 1);
+ ($first_relid = lc($release)) =~ s/\s+/_/g
+ if ($#releases == 0 or ($#releases == 1 and not ($releases[0][0])));
+ ($second_relid = lc($release)) =~ s/\s+/_/g
+ if ( ($#releases == 1 and $releases[0][0])
+ or ($#releases == 2 and not $releases[0][0]));
$items = undef;
next;
}
@@ -90,19 +107,44 @@ for (my $line_num = 0 ; $line_num <= $#l
next;
}
+ if (m!^20\d\d[-/]\d{1,2}[-/]\d{1,2}!) { # Collect dated postscripts
+ my $item = $_;
+ my $line = '';
+ while ($line_num < $#lines and ($line = $lines[++$line_num]) =~ /\S/) {
+ $line =~ s/^\s+//; # Trim leading whitespace
+ $line =~ s/\s+$//; # Trim trailing whitespace
+ $item .= "$line\n";
+ }
+ push @releases, [ $item, '', '', [] ];
+ next;
+ }
+
# Section heading: no leading whitespace, initial word capitalized,
# five words or less, and no trailing punctuation
- if (/^([A-Z]\S*(?:\s+\S+){0,4})(?<![-.:;!()])\s*$/) {
+ if ( /^([A-Z]\S*(?:\s+\S+){0,4})(?<![-.:;!()])\s*$/
+ and not $in_major_component_versions_section) {
my $heading = $1;
$items = [];
+ unless (@releases) {
+ $sections = [];
+ # Make a fake release to hold pre-release sections
+ push @releases, [ undef, undef, undef, $sections ];
+ }
push @$sections, [ $heading, $items ];
+ $in_major_component_versions_section
+ = ($heading =~ /Versions of Major Components/i);
next;
}
# Handle earlier releases without sections - create a headless section
unless ($items) {
$items = [];
- push @$sections, [ undef, $items ];
+ unless (@releases) {
+ $sections = [];
+ # Make a fake release to hold pre-release sections and items
+ push @releases, [ undef, undef, undef, $sections ];
+ }
+ push @$sections, [ '', $items ];
}
my $type;
@@ -130,7 +172,7 @@ for (my $line_num = 0 ; $line_num <= $#l
}
$item =~ s/\n+\Z/\n/; # Trim trailing blank lines
push @$items, $item;
- --$line_num unless ($line_num == $#lines);
+ --$line_num unless ($line_num == $#lines && $lines[$line_num] !~ /^20/);
} elsif ($type eq 'paragraph') { # List item boundary is a blank line
my $line;
my $item = $_;
@@ -139,18 +181,22 @@ for (my $line_num = 0 ; $line_num <= $#l
$item =~ s/\s+$//; # Trim trailing whitespace
$item .= "\n";
- while ($line_num < $#lines and ($line = $lines[++$line_num]) =~ /\S/) {
- $line =~ s/^\s{$leading_ws_width}//; # Trim leading whitespace
- $line =~ s/\s+$//; # Trim trailing whitespace
- $item .= "$line\n";
+ unless ($in_major_component_versions_section) {
+ while ($line_num < $#lines and ($line = $lines[++$line_num]) =~ /\S/) {
+ $line =~ s/^\s{$leading_ws_width}//; # Trim leading whitespace
+ $line =~ s/\s+$//; # Trim trailing whitespace
+ $item .= "$line\n";
+ }
+ } else {
+ ++$line_num;
}
push @$items, $item;
- --$line_num unless ($line_num == $#lines);
+ --$line_num unless ($line_num == $#lines && $lines[$line_num] !~ /^20/);
} else { # $type is one of the bulleted types
# List item boundary is another bullet or a blank line
my $line;
my $item = $_;
- $item =~ s/^(\s*\Q$type\E\s*)//; # Trim the leading bullet
+ $item =~ s/^(\s*\Q$type\E\s*)//; # Trim the leading bullet
my $leading_ws_width = length($1);
$item =~ s/\s+$//; # Trim trailing whitespace
$item .= "\n";
@@ -162,7 +208,7 @@ for (my $line_num = 0 ; $line_num <= $#l
$item .= "$line\n";
}
push @$items, $item;
- --$line_num unless ($line_num == $#lines);
+ --$line_num unless ($line_num == $#lines && $lines[$line_num] !~ /^20/);
}
}
@@ -357,51 +403,73 @@ __HTML_HEADER__
my $heading;
my $relcnt = 0;
my $header = 'h2';
+my $subheader = 'h3';
+
for my $rel (@releases) {
- if (++$relcnt == 3) {
+ if ($relcnt == 2) {
$header = 'h3';
+ $subheader = 'h4';
print "<h2><a id=\"older\" href=\"javascript:toggleList('older')\">";
print "Older Releases";
print "</a></h2>\n";
print "<ul id=\"older.list\">\n"
}
-
+
($release, $reldate, $relinfo, $sections) = @$rel;
# The first section heading is undefined for the older sectionless releases
my $has_release_sections = has_release_sections($sections);
- (my $relid = lc($release)) =~ s/\s+/_/g;
- print "<$header><a id=\"$relid\" href=\"javascript:toggleList('$relid')\">";
- print "Release " unless ($release =~ /^trunk$/i);
- print "$release $relinfo";
- print " [$reldate]" unless ($reldate eq 'unknown');
- print "</a></$header>\n";
- print "<ul id=\"$relid.list\">\n"
- if ($has_release_sections);
+ my $relid = '';
+ if ($release) { # Pre-release sections have no release ID
+ ++$relcnt;
+ ($relid = lc($release)) =~ s/\s+/_/g;
+ print "<$header>";
+ print "<a id=\"$relid\" href=\"javascript:toggleList('$relid')\">"
+ unless ($release =~ /^20\d\d/);
+ print "Release " unless ($release =~ /^trunk$|^20\d\d/i);
+ print "$release $relinfo";
+ print " [$reldate]" unless ($reldate eq 'unknown' or not $reldate);
+ print "</a>" unless ($release =~ /^20\d\d/);
+ print "</$header>\n";
+ print "<ul id=\"$relid.list\">\n"
+ if ($has_release_sections);
+ }
for my $section (@$sections) {
($heading, $items) = @$section;
(my $sectid = lc($heading)) =~ s/\s+/_/g;
my $numItemsStr = $#{$items} > 0 ? "($#{$items})" : "(none)";
- print " <li><a id=\"$relid.$sectid\"",
- " href=\"javascript:toggleList('$relid.$sectid')\">",
- ($heading || ''), "</a> $numItemsStr\n"
- if ($has_release_sections and $heading);
+ my $list_item = "li";
+ if ($release) {
+ if ($heading) {
+ if ($heading eq 'Detailed Change List') {
+ print " <$subheader>$heading</$subheader>\n";
+ next;
+ } elsif ($has_release_sections) {
+ print " <li><a id=\"$relid.$sectid\"",
+ " href=\"javascript:toggleList('$relid.$sectid')\">$heading</a>",
+ " $numItemsStr\n"
+ }
+ }
+ } else { # $release is not defined
+ print "<h2>$heading</h2>\n" if ($heading);
+ $list_item = "p";
+ }
my $list_type = $items->[0] || '';
my $list = ($has_release_sections || $list_type eq 'numbered' ? 'ol' : 'ul');
my $listid = $sectid ? "$relid.$sectid" : $relid;
print " <$list id=\"$listid.list\">\n"
- unless ($has_release_sections and not $heading);
+ unless (not $release or ($has_release_sections and not $heading));
for my $itemnum (1..$#{$items}) {
my $item = $items->[$itemnum];
- $item =~ s:&:&:g; # Escape HTML metachars, but leave
- $item =~ s:<(?!/?code>):<:gi; # <code> tags intact and add <pre>
- $item =~ s:(?<!code)>:>:gi; # wrappers for non-inline sections
- $item =~ s{((?:^|.*\n)\s*)<code>(?!</code>.+)(.+)</code>(?![ \t]*\S)}
+ $item =~ s:&:&:g; # Escape HTML metachars, but leave <code> tags
+ $item =~ s~<(?!/?code>(?:[^,]|$))~<~gi; # intact - unless followed by a comma - and
+ $item =~ s:(?<!code)>:>:gi; # add <pre> wrappers for non-inline sections
+ $item =~ s{((?:^|.*\n)\s*)<code>(?!,)(?!</code>.+)(.+)</code>(?![ \t]*\S)}
{
my $prefix = $1;
my $code = $2;
@@ -409,62 +477,67 @@ for my $rel (@releases) {
"$prefix<code><pre>$code</pre></code>"
}gise;
- # Put attributions on their own lines.
- # Check for trailing parenthesized attribution with no following period.
- # Exclude things like "(see #3 above)" and "(use the bug number instead of xxxx)"
- unless ($item =~ s:\s*(\((?!see #|use the bug number)[^()"]+?\))\s*$:\n<br /><span class="attrib">$1</span>:) {
- # If attribution is not found, then look for attribution with a
- # trailing period, but try not to include trailing parenthesized things
- # that are not attributions.
- #
- # Rule of thumb: if a trailing parenthesized expression with a following
- # period does not contain "LUCENE-XXX", and it either has three or
- # fewer words or it includes the word "via" or the phrase "updates from",
- # then it is considered to be an attribution.
-
- $item =~ s{(\s*(\((?!see \#|use the bug number)[^()"]+?\)))
- ((?:\.|(?i:\.?\s*Issue\s+\d{3,}|LUCENE-\d+)\.?)\s*)$}
- {
- my $subst = $1; # default: no change
- my $parenthetical = $2;
- my $trailing_period_and_or_issue = $3;
- if ($parenthetical !~ /LUCENE-\d+/) {
- my ($no_parens) = $parenthetical =~ /^\((.*)\)$/s;
- my @words = grep {/\S/} split /\s+/, $no_parens;
- if ($no_parens =~ /\b(?:via|updates\s+from)\b/i || scalar(@words) <= 3) {
- $subst = "\n<br /><span class=\"attrib\">$parenthetical</span>";
- }
- }
- $subst . $trailing_period_and_or_issue;
- }ex;
- }
+ $item = markup_trailing_attribution($item) unless ($item =~ /\n[ ]*-/);
$item =~ s{(.*?)(<code><pre>.*?</pre></code>)|(.*)}
{
my $uncode = undef;
- if (defined($2)) {
- $uncode = $1 || '';
+ my ($one,$two,$three) = ($1,$2,$3);
+ if (defined($two)) {
+ $uncode = $one || '';
+ $uncode =~ s{^(.*?)(?=\n[ ]*-)}
+ {
+ my $prefix = $1;
+ my ($primary,$additional_work) = $prefix =~ /^(.*?)((?:\s*Additional\s+Work:\s*)?)$/si;
+ my $result = markup_trailing_attribution($primary);
+ $result .= "<br />\n$additional_work<br />" if ($additional_work);
+ $result;
+ }se;
$uncode =~ s{((?<=\n)[ ]*-.*\n(?:.*\n)*)}
{
my $bulleted_list = $1;
- $bulleted_list
+ $bulleted_list
=~ s{(?:(?<=\n)|\A)[ ]*-[ ]*(.*(?:\n|\z)(?:[ ]+[^ -].*(?:\n|\z))*)}
- {<li class="bulleted-list">\n$1</li>\n}g;
+ {
+ qq!<li class="bulleted-list">\n!
+ . markup_trailing_attribution($1)
+ . "</li>\n"
+ }ge;
$bulleted_list
- =~ s!(<li.*</li>\n)!<ul class="bulleted-list">\n$1</ul>\n!s;
+ =~ s{(<li.*</li>\n)(.*)}
+ {
+ qq!<ul class="bulleted-list">\n$1</ul>\n!
+ . markup_trailing_attribution($2 || '')
+ }se;
$bulleted_list;
}ge;
- "$uncode$2";
+ "$uncode$two";
} else {
- $uncode = $3 || '';
+ $uncode = $three || '';
+ $uncode =~ s{^(.*?)(?=\n[ ]*-)}
+ {
+ my $prefix = $1;
+ my ($primary,$additional_work) = $prefix =~ /^(.*?)((?:\s*Additional\s+Work:\s*)?)$/si;
+ my $result = markup_trailing_attribution($primary);
+ $result .= "<br />\n$additional_work<br />" if ($additional_work);
+ $result;
+ }se;
$uncode =~ s{((?<=\n)[ ]*-.*\n(?:.*\n)*)}
{
my $bulleted_list = $1;
- $bulleted_list
+ $bulleted_list
=~ s{(?:(?<=\n)|\A)[ ]*-[ ]*(.*(?:\n|\z)(?:[ ]+[^ -].*(?:\n|\z))*)}
- {<li class="bulleted-list">\n$1</li>\n}g;
+ {
+ qq!<li class="bulleted-list">\n!
+ . markup_trailing_attribution($1)
+ . "</li>\n"
+ }ge;
$bulleted_list
- =~ s!(<li.*</li>\n)!<ul class="bulleted-list">\n$1</ul>\n!s;
+ =~ s{(<li.*</li>\n)(.*)}
+ {
+ qq!<ul class="bulleted-list">\n$1</ul>\n!
+ . markup_trailing_attribution($2 || '')
+ }se;
$bulleted_list;
}ge;
$uncode;
@@ -480,49 +553,119 @@ for my $rel (@releases) {
# Link Lucene XXX, SOLR XXX and INFRA XXX to JIRA
$item =~ s{((LUCENE|SOLR|INFRA)\s+(\d{3,}))}
{<a href="${jira_url_prefix}\U$2\E-$3">$1</a>}gi;
- # Find single Bugzilla issues
- $item =~ s~((?i:bug|patch|issue)\s*\#?\s*(\d+))
- ~ my $issue = $1;
- my $jira_issue_num = $bugzilla_jira_map{$2}; # Link to JIRA copies
- $issue = qq!<a href="${jira_url_prefix}LUCENE-$jira_issue_num">!
- . qq!$issue [LUCENE-$jira_issue_num]</a>!
- if (defined($jira_issue_num));
- $issue;
- ~gex;
- # Find multiple Bugzilla issues
- $item =~ s~(?<=(?i:bugs))(\s*)(\d+)(\s*(?i:\&|and)\s*)(\d+)
- ~ my $leading_whitespace = $1;
- my $issue_num_1 = $2;
- my $interlude = $3;
- my $issue_num_2 = $4;
- # Link to JIRA copies
- my $jira_issue_1 = $bugzilla_jira_map{$issue_num_1};
- my $issue1
- = qq!<a href="${jira_url_prefix}LUCENE-$jira_issue_1">!
- . qq!$issue_num_1 [LUCENE-$jira_issue_1]</a>!
- if (defined($jira_issue_1));
- my $jira_issue_2 = $bugzilla_jira_map{$issue_num_2};
- my $issue2
- = qq!<a href="${jira_url_prefix}LUCENE-$jira_issue_2">!
- . qq!$issue_num_2 [LUCENE-$jira_issue_2]</a>!
- if (defined($jira_issue_2));
- $leading_whitespace . $issue1 . $interlude . $issue2;
- ~gex;
+ if ($product eq 'LUCENE') {
+ # Find single Bugzilla issues
+ $item =~ s~((?i:bug|patch|issue)\s*\#?\s*(\d+))
+ ~ my $issue = $1;
+ my $jira_issue_num = $lucene_bugzilla_jira_map{$2}; # Link to JIRA copies
+ $issue = qq!<a href="${jira_url_prefix}LUCENE-$jira_issue_num">!
+ . qq!$issue [LUCENE-$jira_issue_num]</a>!
+ if (defined($jira_issue_num));
+ $issue;
+ ~gex;
+ # Find multiple Bugzilla issues
+ $item =~ s~(?<=(?i:bugs))(\s*)(\d+)(\s*(?i:\&|and)\s*)(\d+)
+ ~ my $leading_whitespace = $1;
+ my $issue_num_1 = $2;
+ my $interlude = $3;
+ my $issue_num_2 = $4;
+ # Link to JIRA copies
+ my $jira_issue_1 = $lucene_bugzilla_jira_map{$issue_num_1};
+ my $issue1
+ = qq!<a href="${jira_url_prefix}LUCENE-$jira_issue_1">!
+ . qq!$issue_num_1 [LUCENE-$jira_issue_1]</a>!
+ if (defined($jira_issue_1));
+ my $jira_issue_2 = $lucene_bugzilla_jira_map{$issue_num_2};
+ my $issue2
+ = qq!<a href="${jira_url_prefix}LUCENE-$jira_issue_2">!
+ . qq!$issue_num_2 [LUCENE-$jira_issue_2]</a>!
+ if (defined($jira_issue_2));
+ $leading_whitespace . $issue1 . $interlude . $issue2;
+ ~gex;
+ }
# Linkify URLs, except Bugzilla links, which don't work anymore
- $item =~ s~(?<![">])(https?://(?!(?:nagoya|issues)\.apache\.org/bugzilla)\S+)~<a href="$1">$1</a>~g;
+ $item =~ s~(?<![">])(https?://(?!(?:nagoya|issues)\.apache\.org/bugzilla)[^\s\)]+)~<a href="$1">$1</a>~g;
+
+ $item =~ s~</ul>\s+<p/>\s+<br\s*/>~</ul>~;
- print " <li>$item</li>\n";
+ print " <$list_item>$item</$list_item>\n";
}
- print " </$list>\n" unless ($has_release_sections and not $heading);
- print " </li>\n" if ($has_release_sections);
+ print " </$list>\n" unless (not $release or ($has_release_sections and not $heading));
+ print " </li>\n" if ($release and $has_release_sections);
}
- print "</ul>\n" if ($has_release_sections);
+ print "</ul>\n" if ($release and $has_release_sections);
}
print "</ul>\n" if ($relcnt > 3);
print "</body>\n</html>\n";
+# Subroutine: markup_trailing_attribution
+#
+# Takes one parameter:
+#
+# - text possibly containing a trailing parenthesized attribution
+#
+# Returns one scalar:
+#
+# - text with the the trailing attribution, if any, marked up with the color green
+#
+sub markup_trailing_attribution {
+ my $item = shift;
+
+ # Put attributions on their own lines.
+ # Check for trailing parenthesized attribution with no following period.
+ # Exclude things like "(see #3 above)" and "(use the bug number instead of xxxx)"
+ unless ($item =~ s{\s*(\((?![Ss]ee )
+ (?!spans\b)
+ (?!mainly\ )
+ (?!LUCENE-\d+\))
+ (?!and\ )
+ (?!backported\ )
+ (?!in\ )
+ (?!inverse\ )
+ (?![Tt]he\ )
+ (?!use\ the\ bug\ number)
+ [^()"]+?\))\s*$}
+ {\n<br /><span class="attrib">$1</span>}x) {
+ # If attribution is not found, then look for attribution with a
+ # trailing period, but try not to include trailing parenthesized things
+ # that are not attributions.
+ #
+ # Rule of thumb: if a trailing parenthesized expression with a following
+ # period does not contain "LUCENE-XXX", and it either has three or
+ # fewer words or it includes the word "via" or the phrase "updates from",
+ # then it is considered to be an attribution.
+
+ $item =~ s{(\s*(\((?![Ss]ee\ )
+ (?!spans\b)
+ (?!mainly\ )
+ (?!LUCENE-\d+\))
+ (?!and\ )
+ (?!backported\ )
+ (?!in\ )
+ (?!inverse\ )
+ (?![Tt]he\ )
+ (?!use\ the\ bug\ number)
+ [^()"]+?\)))
+ ((?:\.|(?i:\.?\s*Issue\s+\d{3,}|LUCENE-\d+)\.?)\s*)$}
+ {
+ my $subst = $1; # default: no change
+ my $parenthetical = $2;
+ my $trailing_period_and_or_issue = $3;
+ if ($parenthetical !~ /LUCENE-\d+/) {
+ my ($no_parens) = $parenthetical =~ /^\((.*)\)$/s;
+ my @words = grep {/\S/} split /\s+/, $no_parens;
+ if ($no_parens =~ /\b(?:via|updates\s+from)\b/i || scalar(@words) <= 4) {
+ $subst = "\n<br /><span class=\"attrib\">$parenthetical</span>";
+ }
+ }
+ $subst . $trailing_period_and_or_issue;
+ }ex;
+ }
+ return $item;
+}
+
#
# Subroutine: has_release_sections
#
@@ -636,6 +779,8 @@ sub get_release_date {
# Handle '1.2 RC6', which should be '1.2 final'
$release = '1.2 final' if ($release eq '1.2 RC6');
+ $release =~ s/\.0\.0/\.0/;
+
$reldate = ( exists($release_dates{$release})
? $release_dates{$release}
: 'unknown');
@@ -658,7 +803,9 @@ sub get_release_date {
# as well as those named "final" are included below.
#
sub setup_release_dates {
- my %release_dates
+ my %release_dates;
+ if (uc($product) eq 'LUCENE') {
+ %release_dates
= ( '0.01' => '2000-03-30', '0.04' => '2000-04-19',
'1.0' => '2000-10-04', '1.01b' => '2001-06-02',
'1.2 RC1' => '2001-10-02', '1.2 RC2' => '2001-10-19',
@@ -677,9 +824,11 @@ sub setup_release_dates {
'2.4.0' => '2008-10-06', '2.4.1' => '2009-03-09',
'2.9.0' => '2009-09-23', '2.9.1' => '2009-11-06',
'3.0.0' => '2009-11-25');
+ }
+
+ print STDERR "Retrieving $project_info_url/$product ...\n";
+ my $project_info_json = get_url_contents("$project_info_url/$product");
- my $project_info_json = get_url_contents($project_info_url);
-
my $project_info = json2perl($project_info_json);
for my $version (@{$project_info->{versions}}) {
if ($version->{releaseDate}) {
@@ -750,12 +899,12 @@ sub setup_month_nums {
#
-# setup_bugzilla_jira_map
+# setup_lucene_bugzilla_jira_map
#
# Returns a list of alternating Bugzilla bug IDs and LUCENE-* JIRA issue
-# numbers, for use in populating the %bugzilla_jira_map hash
+# numbers, for use in populating the %lucene_bugzilla_jira_map hash
#
-sub setup_bugzilla_jira_map {
+sub setup_lucene_bugzilla_jira_map {
return ( 4049 => 1, 4102 => 2, 4105 => 3, 4254 => 4,
4555 => 5, 4568 => 6, 4754 => 7, 5313 => 8,
5456 => 9, 6078 => 10, 6091 => 11, 6140 => 12,
@@ -879,7 +1028,14 @@ sub json2perl {
my $json_string = shift;
$json_string =~ s/(:\s*)(true|false)/$1"$2"/g;
$json_string =~ s/":/",/g;
- return eval $json_string;
+ $json_string =~ s/\'/\\'/g;
+ $json_string =~ s/\"/\'/g;
+ my $project_info = eval $json_string;
+ die "ERROR eval'ing munged JSON string ||$json_string||: $@\n"
+ if ($@);
+ die "ERROR empty value after eval'ing JSON string ||$json_string||\n"
+ unless $project_info;
+ return $project_info;
}
1;
Modified: lucene/dev/branches/LUCENE-2878/lucene/site/xsl/index.xsl
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/site/xsl/index.xsl?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/site/xsl/index.xsl (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/site/xsl/index.xsl Fri Sep 21 17:21:34 2012
@@ -26,7 +26,7 @@
<!--
NOTE: This template matches the root element of any given input XML document!
The XSL input file is ignored completely, but XSL expects one to be given,
- so build.xml passes itsself here. The list of module build.xmls is given via
+ so build.xml passes itself here. The list of module build.xmls is given via
string parameter, that must be splitted at '|'.
-->
<xsl:template match="/">
@@ -35,7 +35,7 @@
<title><xsl:text>Apache Lucene </xsl:text><xsl:value-of select="$version"/><xsl:text> Documentation</xsl:text></title>
</head>
<body>
- <div><img src="lucene_green_300.gif"/></div>
+ <div><a href="http://lucene.apache.org/core/"><img src="lucene_green_300.gif" title="Apache Lucene Logo" alt="Lucene" border="0"/></a></div>
<h1><xsl:text>Apache Lucene </xsl:text><xsl:value-of select="$version"/><xsl:text> Documentation</xsl:text></h1>
<p>Lucene is a Java full-text search engine. Lucene is not a complete application,
but rather a code library and API that can easily be used to add search capabilities
@@ -65,7 +65,7 @@
<li><a href="changes/Changes.html">Changes</a>: List of changes in this release.</li>
<li><a href="MIGRATE.html">Migration Guide</a>: What changed in Lucene 4; how to migrate code from Lucene 3.x.</li>
<li><a href="JRE_VERSION_MIGRATION.html">JRE Version Migration</a>: Information about upgrading between major JRE versions.</li>
- <li><a href="core/org/apache/lucene/codecs/lucene40/package-summary.html#package_description">File Formats</a>: Guide to the index format used by Lucene.</li>
+ <li><a href="core/org/apache/lucene/codecs/lucene40/package-summary.html#package_description">File Formats</a>: Guide to the supported index format used by Lucene. This can be customized by using <a href="core/org/apache/lucene/codecs/package-summary.html#package_description">an alternate codec</a>.</li>
<li><a href="core/org/apache/lucene/search/package-summary.html#package_description">Search and Scoring in Lucene</a>: Introduction to how Lucene scores documents.</li>
<li><a href="core/org/apache/lucene/search/similarities/TFIDFSimilarity.html">Classic Scoring Formula</a>: Formula of Lucene's classic <a href="http://en.wikipedia.org/wiki/Vector_Space_Model">Vector Space</a> implementation. (look <a href="core/org/apache/lucene/search/similarities/package-summary.html#package_description">here</a> for other models)</li>
<li><a href="queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package_description">Classic QueryParser Syntax</a>: Overview of the Classic QueryParser's syntax and features.</li>
Modified: lucene/dev/branches/LUCENE-2878/lucene/spatial/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/spatial/build.xml?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/spatial/build.xml (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/spatial/build.xml Fri Sep 21 17:21:34 2012
@@ -7,7 +7,7 @@
<import file="../module-build.xml"/>
<path id="spatialjar">
- <pathelement path="lib/spatial4j-0.2.jar"/>
+ <pathelement path="lib/spatial4j-0.3.jar"/>
</path>
<path id="classpath">
Modified: lucene/dev/branches/LUCENE-2878/lucene/spatial/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/spatial/ivy.xml?rev=1388574&r1=1388573&r2=1388574&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/spatial/ivy.xml (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/spatial/ivy.xml Fri Sep 21 17:21:34 2012
@@ -19,7 +19,7 @@
<ivy-module version="2.0">
<info organisation="org.apache.lucene" module="spatial"/>
<dependencies>
- <dependency org="com.spatial4j" name="spatial4j" rev="0.2" transitive="false"/>
+ <dependency org="com.spatial4j" name="spatial4j" rev="0.3" transitive="false"/>
<exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
</dependencies>
</ivy-module>