You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2015/09/02 15:06:22 UTC
svn commit: r1700800 [6/24] - in /lucene/dev/branches/lucene6699: ./
dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/ dev-tools/scripts/
lucene/ lucene/analysis/ lucene/analysis/common/
lucene/analysis/common/src/java/org/apache/lucene/analysis/ar/ ...
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.java Wed Sep 2 13:06:13 2015
@@ -1,6 +1,6 @@
/* Generated By:JavaCC: Do not edit this line. StandardSyntaxParserTokenManager.java */
package org.apache.lucene.queryparser.flexible.standard.parser;
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -40,6 +40,7 @@ import org.apache.lucene.queryparser.fle
import org.apache.lucene.queryparser.flexible.standard.nodes.TermRangeQueryNode;
/** Token Manager. */
+@SuppressWarnings("cast")
public class StandardSyntaxParserTokenManager implements StandardSyntaxParserConstants
{
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/BooleanQuery2ModifierNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/BooleanQuery2ModifierNodeProcessor.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/BooleanQuery2ModifierNodeProcessor.java (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/BooleanQuery2ModifierNodeProcessor.java Wed Sep 2 13:06:13 2015
@@ -1,6 +1,6 @@
package org.apache.lucene.queryparser.flexible.standard.processors;
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj Wed Sep 2 13:06:13 2015
@@ -1,4 +1,4 @@
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParserTokenManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParserTokenManager.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParserTokenManager.java (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/parser/QueryParserTokenManager.java Wed Sep 2 13:06:13 2015
@@ -15,6 +15,7 @@ import org.apache.lucene.queryparser.sur
import org.apache.lucene.queryparser.surround.query.SrndTruncQuery;
/** Token Manager. */
+@SuppressWarnings("cast")
public class QueryParserTokenManager implements QueryParserConstants
{
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/OrQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/OrQuery.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/OrQuery.java (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/OrQuery.java Wed Sep 2 13:06:13 2015
@@ -40,9 +40,9 @@ public class OrQuery extends ComposedQue
@Override
public String distanceSubQueryNotAllowed() {
- Iterator sqi = getSubQueriesIterator();
+ Iterator<SrndQuery> sqi = getSubQueriesIterator();
while (sqi.hasNext()) {
- SrndQuery leq = (SrndQuery) sqi.next();
+ SrndQuery leq = sqi.next();
if (leq instanceof DistanceSubQuery) {
String m = ((DistanceSubQuery)leq).distanceSubQueryNotAllowed();
if (m != null) {
@@ -57,9 +57,10 @@ public class OrQuery extends ComposedQue
@Override
public void addSpanQueries(SpanNearClauseFactory sncf) throws IOException {
- Iterator sqi = getSubQueriesIterator();
+ Iterator<SrndQuery> sqi = getSubQueriesIterator();
while (sqi.hasNext()) {
- ((DistanceSubQuery)sqi.next()).addSpanQueries(sncf);
+ SrndQuery s = sqi.next();
+ ((DistanceSubQuery) s).addSpanQueries(sncf);
}
}
}
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/RewriteQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/RewriteQuery.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/RewriteQuery.java (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/RewriteQuery.java Wed Sep 2 13:06:13 2015
@@ -61,7 +61,7 @@ abstract class RewriteQuery<SQ extends S
return false;
if (! getClass().equals(obj.getClass()))
return false;
- RewriteQuery other = (RewriteQuery)obj;
+ @SuppressWarnings("unchecked") RewriteQuery<SQ> other = (RewriteQuery<SQ>)obj;
return super.equals(obj)
&& fieldName.equals(other.fieldName)
&& qf.equals(other.qf)
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/QueryTemplateManager.java Wed Sep 2 13:06:13 2015
@@ -176,9 +176,9 @@ public class QueryTemplateManager {
Element root = doc.createElement("Document");
doc.appendChild(root);
- Enumeration keysEnum = formProperties.keys();
+ Enumeration<?> keysEnum = formProperties.propertyNames();
while (keysEnum.hasMoreElements()) {
- String propName = (String) keysEnum.nextElement();
+ String propName = keysEnum.nextElement().toString();
String value = formProperties.getProperty(propName);
if ((value != null) && (value.length() > 0)) {
DOMUtils.insertChild(root, propName, value);
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/java/overview.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/java/overview.html?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/java/overview.html (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/java/overview.html Wed Sep 2 13:06:13 2015
@@ -63,8 +63,8 @@ It's currently divided in 2 main package
that can be converted into similar syntax QueryNode trees.</li>
<li>QueryNode Processors - Optimize, validate, rewrite the
QueryNode trees</li>
- <li>Processors Pipelines - Select your favorite Processor
- and build a processor pipeline, to implement the features you need</li>
+ <li>Processors Pipelines - Select your favorite Processor
+ and build a processor pipeline, to implement the features you need</li>
<li>Config Interfaces - Allow the consumer of the Query Parser to implement
a diff Config Handler Objects to suite their needs.</li>
<li>Standard Builders - convert QueryNode's into several lucene
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/classic/TestQueryParser.java Wed Sep 2 13:06:13 2015
@@ -156,14 +156,13 @@ public class TestQueryParser extends Que
@SuppressWarnings("rawtype")
public void testProtectedCtors() throws Exception {
try {
- QueryParser.class.getConstructor(new Class[] {CharStream.class});
+ QueryParser.class.getConstructor(CharStream.class);
fail("please switch public QueryParser(CharStream) to be protected");
} catch (NoSuchMethodException nsme) {
// expected
}
try {
- QueryParser.class
- .getConstructor(new Class[] {QueryParserTokenManager.class});
+ QueryParser.class.getConstructor(QueryParserTokenManager.class);
fail("please switch public QueryParser(QueryParserTokenManager) to be protected");
} catch (NoSuchMethodException nsme) {
// expected
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/BooleanQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/BooleanQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/BooleanQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/BooleanQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,13 +16,13 @@
limitations under the License.
-->
<BooleanQuery fieldName="contents">
- <Clause occurs="should">
- <TermQuery>merger</TermQuery>
- </Clause>
- <Clause occurs="mustnot">
- <TermQuery>sumitomo</TermQuery>
- </Clause>
- <Clause occurs="must">
- <TermQuery>bank</TermQuery>
- </Clause>
+ <Clause occurs="should">
+ <TermQuery>merger</TermQuery>
+ </Clause>
+ <Clause occurs="mustnot">
+ <TermQuery>sumitomo</TermQuery>
+ </Clause>
+ <Clause occurs="must">
+ <TermQuery>bank</TermQuery>
+ </Clause>
</BooleanQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/BoostingQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/BoostingQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/BoostingQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/BoostingQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,18 +16,18 @@
limitations under the License.
-->
<BoostingQuery>
- <!-- Find docs about banks, preferably merger info and preferably not "World bank" -->
- <Query>
- <BooleanQuery fieldName="contents">
- <Clause occurs="should">
- <TermQuery>merger</TermQuery>
- </Clause>
- <Clause occurs="must">
- <TermQuery>bank</TermQuery>
- </Clause>
- </BooleanQuery>
- </Query>
- <BoostQuery boost="0.01">
- <UserQuery>"world bank"</UserQuery>
- </BoostQuery>
+ <!-- Find docs about banks, preferably merger info and preferably not "World bank" -->
+ <Query>
+ <BooleanQuery fieldName="contents">
+ <Clause occurs="should">
+ <TermQuery>merger</TermQuery>
+ </Clause>
+ <Clause occurs="must">
+ <TermQuery>bank</TermQuery>
+ </Clause>
+ </BooleanQuery>
+ </Query>
+ <BoostQuery boost="0.01">
+ <UserQuery>"world bank"</UserQuery>
+ </BoostQuery>
</BoostingQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/CachedQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/CachedQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/CachedQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/CachedQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,36 +16,36 @@
limitations under the License.
-->
<BooleanQuery fieldName="contents">
- <Clause occurs="should">
- <TermQuery>merger</TermQuery>
- </Clause>
- <Clause occurs="mustnot">
- <TermQuery >sumitomo</TermQuery>
- </Clause>
- <Clause occurs="filter">
- <!--
- CachedFilter elements can contain any Query or Filter.
- CachedFilters are cached in an LRU Cache keyed on the contained query/filter object.
- Using this will speed up overall performance for repeated uses of the same expensive
- query/filter. The sorts of queries 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 - "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
- QueryFilter bitset.
-
- 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.
-
- The CoreParser.maxNumCachedFilters property can be used to control the size
- of the LRU Cache established during the construction of CoreParser instances.
- -->
- <CachedQuery>
- <!-- Example query to be cached for fast, repeated use -->
- <TermQuery fieldName="contents">bank</TermQuery>
- <!-- Alternatively, a filter object can be cached ....
- <RangeFilter fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>
- -->
- </CachedQuery>
- </Clause>
+ <Clause occurs="should">
+ <TermQuery>merger</TermQuery>
+ </Clause>
+ <Clause occurs="mustnot">
+ <TermQuery >sumitomo</TermQuery>
+ </Clause>
+ <Clause occurs="filter">
+ <!--
+ CachedFilter elements can contain any Query or Filter.
+ CachedFilters are cached in an LRU Cache keyed on the contained query/filter object.
+ Using this will speed up overall performance for repeated uses of the same expensive
+ query/filter. The sorts of queries 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 - "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
+ QueryFilter bitset.
+
+ 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.
+
+ The CoreParser.maxNumCachedFilters property can be used to control the size
+ of the LRU Cache established during the construction of CoreParser instances.
+ -->
+ <CachedQuery>
+ <!-- Example query to be cached for fast, repeated use -->
+ <TermQuery fieldName="contents">bank</TermQuery>
+ <!-- Alternatively, a filter object can be cached ....
+ <RangeFilter fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>
+ -->
+ </CachedQuery>
+ </Clause>
</BooleanQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/ConstantScoreQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/ConstantScoreQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/ConstantScoreQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/ConstantScoreQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,5 +16,5 @@
limitations under the License.
-->
<ConstantScoreQuery>
- <RangeQuery fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>
+ <RangeQuery fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>
</ConstantScoreQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/DisjunctionMaxQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/DisjunctionMaxQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/DisjunctionMaxQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/DisjunctionMaxQuery.xml Wed Sep 2 13:06:13 2015
@@ -17,8 +17,8 @@
-->
<DisjunctionMaxQuery>
- <TermQuery fieldName="a">merger</TermQuery>
- <DisjunctionMaxQuery tieBreaker="1.2">
- <TermQuery fieldName="b">verger</TermQuery>
- </DisjunctionMaxQuery>
+ <TermQuery fieldName="a">merger</TermQuery>
+ <DisjunctionMaxQuery tieBreaker="1.2">
+ <TermQuery fieldName="b">verger</TermQuery>
+ </DisjunctionMaxQuery>
</DisjunctionMaxQuery>
\ No newline at end of file
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/FuzzyLikeThisQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/FuzzyLikeThisQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/FuzzyLikeThisQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/FuzzyLikeThisQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,8 +16,8 @@
limitations under the License.
-->
<FuzzyLikeThisQuery>
- <!-- Matches on misspelt "Sumitomo" bank -->
- <Field fieldName="contents">
- Sumitimo bank
- </Field>
+ <!-- Matches on misspelt "Sumitomo" bank -->
+ <Field fieldName="contents">
+ Sumitimo bank
+ </Field>
</FuzzyLikeThisQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/LikeThisQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/LikeThisQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/LikeThisQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/LikeThisQuery.xml Wed Sep 2 13:06:13 2015
@@ -17,17 +17,17 @@
-->
<LikeThisQuery percentTermsToMatch="5" stopWords="Reuter" minDocFreq="2">
IRAQI TROOPS REPORTED PUSHING BACK IRANIANS Iraq said today its troops were pushing Iranian forces out of
- positions they had initially occupied when they launched a new offensive near the southern port of
- Basra early yesterday. A High Command communique said Iraqi troops had won a significant victory
- and were continuing to advance. Iraq said it had foiled a three-pronged thrust some 10 km
- (six miles) from Basra, but admitted the Iranians had occupied ground held by the Mohammed al-Qassem
- unit, one of three divisions attacked. The communique said Iranian Revolutionary Guards were under
- assault from warplanes, helicopter gunships, heavy artillery and tanks. "Our forces are continuing
- their advance until they purge the last foothold" occupied by the Iranians, it said.
- (Iran said its troops had killed or wounded more than 4,000 Iraqis and were stabilising their new positions.)
- The Baghdad communique said Iraqi planes also destroyed oil installations at Iran's southwestern Ahvaz field
- during a raid today. It denied an Iranian report that an Iraqi jet was shot down.
- Iraq also reported a naval battle at the northern tip of the Gulf. Iraqi naval units and forces defending an
- offshore terminal sank six Iranian out of 28 Iranian boats attempting to attack an offshore terminal,
- the communique said. Reuter 3;
+ positions they had initially occupied when they launched a new offensive near the southern port of
+ Basra early yesterday. A High Command communique said Iraqi troops had won a significant victory
+ and were continuing to advance. Iraq said it had foiled a three-pronged thrust some 10 km
+ (six miles) from Basra, but admitted the Iranians had occupied ground held by the Mohammed al-Qassem
+ unit, one of three divisions attacked. The communique said Iranian Revolutionary Guards were under
+ assault from warplanes, helicopter gunships, heavy artillery and tanks. "Our forces are continuing
+ their advance until they purge the last foothold" occupied by the Iranians, it said.
+ (Iran said its troops had killed or wounded more than 4,000 Iraqis and were stabilising their new positions.)
+ The Baghdad communique said Iraqi planes also destroyed oil installations at Iran's southwestern Ahvaz field
+ during a raid today. It denied an Iranian report that an Iraqi jet was shot down.
+ Iraq also reported a naval battle at the northern tip of the Gulf. Iraqi naval units and forces defending an
+ offshore terminal sank six Iranian out of 28 Iranian boats attempting to attack an offshore terminal,
+ the communique said. Reuter 3;
</LikeThisQuery>
\ No newline at end of file
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/MatchAllDocsQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/MatchAllDocsQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/MatchAllDocsQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/MatchAllDocsQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,10 +16,10 @@
limitations under the License.
-->
<BooleanQuery>
- <Clause occurs="must">
- <MatchAllDocsQuery/>
- </Clause>
- <Clause occurs="filter">
- <RangeQuery fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>
- </Clause>
+ <Clause occurs="must">
+ <MatchAllDocsQuery/>
+ </Clause>
+ <Clause occurs="filter">
+ <RangeQuery fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>
+ </Clause>
</BooleanQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/NestedBooleanQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/NestedBooleanQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/NestedBooleanQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/NestedBooleanQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,21 +16,21 @@
limitations under the License.
-->
<!--
- This query was added to demonstrate nested boolean queries - there
- was a bug in the XML parser which added ALL child <Clause> tags to
- the top level tags ie. took child and grandchild elements instead
- of just child elements. This was due to the use of the
- Element.getElementsByTagName() call in BooleanQueryBuilder
--->
-<BooleanQuery fieldName="contents">
- <Clause occurs="should">
- <BooleanQuery fieldName="contents">
- <Clause occurs="must">
- <TermQuery>doesNotExistButShouldBeOKBecauseOtherClauseExists</TermQuery>
- </Clause>
- </BooleanQuery>
- </Clause>
- <Clause occurs="should">
- <TermQuery>bank</TermQuery>
- </Clause>
+ This query was added to demonstrate nested boolean queries - there
+ was a bug in the XML parser which added ALL child <Clause> tags to
+ the top level tags ie. took child and grandchild elements instead
+ of just child elements. This was due to the use of the
+ Element.getElementsByTagName() call in BooleanQueryBuilder
+-->
+<BooleanQuery fieldName="contents">
+ <Clause occurs="should">
+ <BooleanQuery fieldName="contents">
+ <Clause occurs="must">
+ <TermQuery>doesNotExistButShouldBeOKBecauseOtherClauseExists</TermQuery>
+ </Clause>
+ </BooleanQuery>
+ </Clause>
+ <Clause occurs="should">
+ <TermQuery>bank</TermQuery>
+ </Clause>
</BooleanQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/NumericRangeQueryQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/NumericRangeQueryQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/NumericRangeQueryQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/NumericRangeQueryQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,16 +16,16 @@
limitations under the License.
-->
<BooleanQuery fieldName="contents">
- <Clause occurs="should">
- <TermQuery>merger</TermQuery>
- </Clause>
- <Clause occurs="mustnot">
- <TermQuery >sumitomo</TermQuery>
- </Clause>
- <Clause occurs="must">
- <TermQuery>bank</TermQuery>
- </Clause>
- <Clause occurs="must">
- <NumericRangeQuery fieldName="date2" lowerTerm="19870409" upperTerm="19870412"/>
- </Clause>
+ <Clause occurs="should">
+ <TermQuery>merger</TermQuery>
+ </Clause>
+ <Clause occurs="mustnot">
+ <TermQuery >sumitomo</TermQuery>
+ </Clause>
+ <Clause occurs="must">
+ <TermQuery>bank</TermQuery>
+ </Clause>
+ <Clause occurs="must">
+ <NumericRangeQuery fieldName="date2" lowerTerm="19870409" upperTerm="19870412"/>
+ </Clause>
</BooleanQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/SpanQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/SpanQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/SpanQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/SpanQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,40 +16,40 @@
limitations under the License.
-->
<SpanOr fieldName="contents">
- <SpanNear slop="8" inOrder="false" >
- <SpanOr>
- <SpanTerm>killed</SpanTerm>
- <SpanTerm>died</SpanTerm>
- <SpanTerm>dead</SpanTerm>
- </SpanOr>
- <SpanOr>
- <!-- a less verbose way of declaring SpanTerm declarations - these are analyzed
- into a series of Tokens which are added as SpanTerm elements of a SpanOr
- -->
- <SpanOrTerms>miner miners</SpanOrTerms>
- <!-- finds mine near worker or workers -->
- <SpanNear slop="6" inOrder="false">
- <SpanTerm>mine</SpanTerm>
- <SpanOrTerms>worker workers</SpanOrTerms>
+ <SpanNear slop="8" inOrder="false" >
+ <SpanOr>
+ <SpanTerm>killed</SpanTerm>
+ <SpanTerm>died</SpanTerm>
+ <SpanTerm>dead</SpanTerm>
+ </SpanOr>
+ <SpanOr>
+ <!-- a less verbose way of declaring SpanTerm declarations - these are analyzed
+ into a series of Tokens which are added as SpanTerm elements of a SpanOr
+ -->
+ <SpanOrTerms>miner miners</SpanOrTerms>
+ <!-- finds mine near worker or workers -->
+ <SpanNear slop="6" inOrder="false">
+ <SpanTerm>mine</SpanTerm>
+ <SpanOrTerms>worker workers</SpanOrTerms>
<BoostingTermQuery>heavy</BoostingTermQuery>
</SpanNear>
- </SpanOr>
- </SpanNear>
- <SpanFirst end="10">
- <SpanOrTerms>fire burn</SpanOrTerms>
- </SpanFirst>
- <!-- Other Span examples....
-
- <SpanNot>
- <Include>
- <SpanNear slop="2" inOrder="2">
- <SpanTerm>social</SpanTerm>
- <SpanTerm>services</SpanTerm>
- </SpanNear>
- </Include>
- <Exclude>
- <SpanTerm>public</SpanTerm>
- </Exclude>
- </SpanNot>
- -->
+ </SpanOr>
+ </SpanNear>
+ <SpanFirst end="10">
+ <SpanOrTerms>fire burn</SpanOrTerms>
+ </SpanFirst>
+ <!-- Other Span examples....
+
+ <SpanNot>
+ <Include>
+ <SpanNear slop="2" inOrder="2">
+ <SpanTerm>social</SpanTerm>
+ <SpanTerm>services</SpanTerm>
+ </SpanNear>
+ </Include>
+ <Exclude>
+ <SpanTerm>public</SpanTerm>
+ </Exclude>
+ </SpanNot>
+ -->
</SpanOr>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TermsQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TermsQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TermsQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/TermsQuery.xml Wed Sep 2 13:06:13 2015
@@ -15,12 +15,12 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
- <!-- TermsQuery uses an analyzer to tokenize text and creates a BooleanQuery with nested
- "should" TermQueries for each of the tokens encountered. This can be used for user input
- which may include content or characters that would otherwise be illegal query syntax when
- using the standard lucene query parser. Of course the downside is that none of the query
- operators (AND NOT ~ ^ : etc) will have an effect. For some scenarios queries are
- not formed by people familiar with Lucene query syntax and they can inadvertently type illegal
- query syntax so in these cases this is an appropriate and simple alternative
- -->
+ <!-- TermsQuery uses an analyzer to tokenize text and creates a BooleanQuery with nested
+ "should" TermQueries for each of the tokens encountered. This can be used for user input
+ which may include content or characters that would otherwise be illegal query syntax when
+ using the standard lucene query parser. Of course the downside is that none of the query
+ operators (AND NOT ~ ^ : etc) will have an effect. For some scenarios queries are
+ not formed by people familiar with Lucene query syntax and they can inadvertently type illegal
+ query syntax so in these cases this is an appropriate and simple alternative
+ -->
<TermsQuery fieldName="contents">sumitomo bank</TermsQuery>
\ No newline at end of file
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/UserInputQuery.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/UserInputQuery.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/UserInputQuery.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/UserInputQuery.xml Wed Sep 2 13:06:13 2015
@@ -16,10 +16,10 @@
limitations under the License.
-->
<BooleanQuery>
- <Clause occurs="must">
- <UserQuery>"Bank of England"</UserQuery>
- </Clause>
- <Clause occurs="filter">
- <RangeQuery fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>
- </Clause>
+ <Clause occurs="must">
+ <UserQuery>"Bank of England"</UserQuery>
+ </Clause>
+ <Clause occurs="filter">
+ <RangeQuery fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>
+ </Clause>
</BooleanQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumBooleanQuery.xsl
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumBooleanQuery.xsl?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumBooleanQuery.xsl (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumBooleanQuery.xsl Wed Sep 2 13:06:13 2015
@@ -18,29 +18,29 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/Document">
<!--This template ANDs all fields together. Within a single field all terms are ORed.
- The query fields are fed directly through an analyzer and so do not need to adhere to
- traditional Lucene query syntax.
- -->
+ The query fields are fed directly through an analyzer and so do not need to adhere to
+ traditional Lucene query syntax.
+ -->
<BooleanQuery>
- <xsl:if test="count(artist)>0">
- <Clause occurs="must">
- <TermsQuery fieldName="artist"><xsl:value-of select="artist"/></TermsQuery>
- </Clause>
+ <xsl:if test="count(artist)>0">
+ <Clause occurs="must">
+ <TermsQuery fieldName="artist"><xsl:value-of select="artist"/></TermsQuery>
+ </Clause>
</xsl:if>
- <xsl:if test="count(album)>0">
- <Clause occurs="must">
- <TermsQuery fieldName="album"><xsl:value-of select="album"/></TermsQuery>
- </Clause>
+ <xsl:if test="count(album)>0">
+ <Clause occurs="must">
+ <TermsQuery fieldName="album"><xsl:value-of select="album"/></TermsQuery>
+ </Clause>
</xsl:if>
- <xsl:if test="count(genre)>0">
- <Clause occurs="must">
- <TermsQuery fieldName="genre"><xsl:value-of select="genre"/></TermsQuery>
- </Clause>
+ <xsl:if test="count(genre)>0">
+ <Clause occurs="must">
+ <TermsQuery fieldName="genre"><xsl:value-of select="genre"/></TermsQuery>
+ </Clause>
</xsl:if>
- <xsl:if test="count(releaseDate)>0">
- <Clause occurs="must">
- <TermsQuery fieldName="releaseDate"><xsl:value-of select="releaseDate"/></TermsQuery>
- </Clause>
+ <xsl:if test="count(releaseDate)>0">
+ <Clause occurs="must">
+ <TermsQuery fieldName="releaseDate"><xsl:value-of select="releaseDate"/></TermsQuery>
+ </Clause>
</xsl:if>
</BooleanQuery>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumFilteredQuery.xsl
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumFilteredQuery.xsl?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumFilteredQuery.xsl (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumFilteredQuery.xsl Wed Sep 2 13:06:13 2015
@@ -18,30 +18,30 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/Document">
<!-- This template uses an efficient, cached filter for the "genre" field".
- Other query fields are fed directly through an analyzer and so do not need to adhere to
- traditional Lucene query syntax. Terms within a field are ORed while different fields are ANDed
- -->
- <BooleanQuery>
- <xsl:if test="count(artist)>0">
- <Clause occurs="must">
- <TermsQuery fieldName="artist"><xsl:value-of select="artist"/></TermsQuery>
- </Clause>
- </xsl:if>
- <xsl:if test="count(album)>0">
- <Clause occurs="must">
- <TermsQuery fieldName="album"><xsl:value-of select="album"/></TermsQuery>
- </Clause>
- </xsl:if>
- <xsl:if test="count(releaseDate)>0">
- <Clause occurs="must">
- <TermsQuery fieldName="releaseDate"><xsl:value-of select="releaseDate"/></TermsQuery>
- </Clause>
- </xsl:if>
- <Clause occurs="filter">
- <TermsQuery fieldName="genre">
- <xsl:value-of select="genre"/>
- </TermsQuery>
- </Clause>
- </BooleanQuery>
+ Other query fields are fed directly through an analyzer and so do not need to adhere to
+ traditional Lucene query syntax. Terms within a field are ORed while different fields are ANDed
+ -->
+ <BooleanQuery>
+ <xsl:if test="count(artist)>0">
+ <Clause occurs="must">
+ <TermsQuery fieldName="artist"><xsl:value-of select="artist"/></TermsQuery>
+ </Clause>
+ </xsl:if>
+ <xsl:if test="count(album)>0">
+ <Clause occurs="must">
+ <TermsQuery fieldName="album"><xsl:value-of select="album"/></TermsQuery>
+ </Clause>
+ </xsl:if>
+ <xsl:if test="count(releaseDate)>0">
+ <Clause occurs="must">
+ <TermsQuery fieldName="releaseDate"><xsl:value-of select="releaseDate"/></TermsQuery>
+ </Clause>
+ </xsl:if>
+ <Clause occurs="filter">
+ <TermsQuery fieldName="genre">
+ <xsl:value-of select="genre"/>
+ </TermsQuery>
+ </Clause>
+ </BooleanQuery>
</xsl:template>
</xsl:stylesheet>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumLuceneClassicQuery.xsl
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumLuceneClassicQuery.xsl?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumLuceneClassicQuery.xsl (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/src/test/org/apache/lucene/queryparser/xml/albumLuceneClassicQuery.xsl Wed Sep 2 13:06:13 2015
@@ -18,11 +18,11 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/Document">
<!-- This template is designed to work with a google-like search form - one edit box and
- uses the traditional Lucene query syntax
- -->
+ uses the traditional Lucene query syntax
+ -->
<BooleanQuery>
<Clause occurs="must">
- <UserQuery><xsl:value-of select="queryString"/></UserQuery>
+ <UserQuery><xsl:value-of select="queryString"/></UserQuery>
</Clause>
</BooleanQuery>
</xsl:template>
Modified: lucene/dev/branches/lucene6699/lucene/queryparser/xmldtddocbuild.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/queryparser/xmldtddocbuild.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/queryparser/xmldtddocbuild.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/queryparser/xmldtddocbuild.xml Wed Sep 2 13:06:13 2015
@@ -19,7 +19,7 @@
<project name="DTDDocAnt" default="main">
- <import file="../../lucene/module-build.xml"/>
+ <import file="../../lucene/module-build.xml"/>
<description>
This file generates DTDdocumentation
Modified: lucene/dev/branches/lucene6699/lucene/replicator/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/replicator/build.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/replicator/build.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/replicator/build.xml Wed Sep 2 13:06:13 2015
@@ -27,17 +27,17 @@
<import file="../module-build.xml"/>
<path id="classpath">
- <fileset dir="lib" />
+ <fileset dir="lib" />
<pathelement path="${facet.jar}"/>
<path refid="base.classpath"/>
</path>
- <target name="resolve" depends="common.resolve">
- <sequential>
- <!-- javax.servlet jar -->
- <ivy:retrieve conf="servlet" log="download-only" type="orbit" symlink="${ivy.symlink}"/>
- </sequential>
- </target>
+ <target name="resolve" depends="common.resolve">
+ <sequential>
+ <!-- javax.servlet jar -->
+ <ivy:retrieve conf="servlet" log="download-only" type="orbit" symlink="${ivy.symlink}"/>
+ </sequential>
+ </target>
<target name="init" depends="module-build.init,jar-facet"/>
Modified: lucene/dev/branches/lucene6699/lucene/replicator/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/replicator/ivy.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/replicator/ivy.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/replicator/ivy.xml Wed Sep 2 13:06:13 2015
@@ -20,7 +20,7 @@
<info organisation="org.apache.lucene" module="replicator"/>
<configurations defaultconfmapping="http->master;jetty->master;start->master;servlet->master;logging->master">
- <conf name="http" description="httpclient jars" transitive="false"/>
+ <conf name="http" description="httpclient jars" transitive="false"/>
<conf name="jetty" description="jetty jars" transitive="false"/>
<conf name="start" description="jetty start jar" transitive="false"/>
<conf name="servlet" description="servlet-api jar" transitive="false"/>
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeDocValuesProducer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeDocValuesProducer.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeDocValuesProducer.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeDocValuesProducer.java Wed Sep 2 13:06:13 2015
@@ -99,8 +99,13 @@ class BKDTreeDocValuesProducer extends D
if (fp == null) {
throw new IllegalArgumentException("this field was not indexed as a BKDPointField");
}
- datIn.seek(fp);
- treeReader = new BKDTreeReader(datIn, maxDoc);
+
+ // LUCENE-6697: never do real IOPs with the original IndexInput because search
+ // threads can be concurrently cloning it:
+ IndexInput clone = datIn.clone();
+
+ clone.seek(fp);
+ treeReader = new BKDTreeReader(clone, maxDoc);
// Only hang onto the reader when we are not merging:
if (merging == false) {
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java Wed Sep 2 13:06:13 2015
@@ -220,7 +220,7 @@ class BKDTreeWriter {
if (success) {
IOUtils.close(sortedWriter, reader);
} else {
- IOUtils.closeWhileHandlingException(reader);
+ IOUtils.closeWhileHandlingException(sortedWriter, reader);
try {
sortedWriter.destroy();
} catch (Throwable t) {
@@ -287,6 +287,7 @@ class BKDTreeWriter {
heapWriter.ords[i],
heapWriter.docIDs[i]);
}
+ sorted.close();
return sorted;
} else {
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/HeapLatLonWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/HeapLatLonWriter.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/HeapLatLonWriter.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/HeapLatLonWriter.java Wed Sep 2 13:06:13 2015
@@ -23,6 +23,7 @@ final class HeapLatLonWriter implements
final int[] docIDs;
final long[] ords;
private int nextWrite;
+ private boolean closed;
public HeapLatLonWriter(int count) {
latEncs = new int[count];
@@ -42,11 +43,13 @@ final class HeapLatLonWriter implements
@Override
public LatLonReader getReader(long start) {
+ assert closed;
return new HeapLatLonReader(latEncs, lonEncs, ords, docIDs, (int) start, latEncs.length);
}
@Override
public void close() {
+ closed = true;
if (nextWrite != latEncs.length) {
throw new IllegalStateException("only wrote " + nextWrite + " values, but expected " + latEncs.length);
}
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/OfflineLatLonWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/OfflineLatLonWriter.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/OfflineLatLonWriter.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/bkdtree/OfflineLatLonWriter.java Wed Sep 2 13:06:13 2015
@@ -34,6 +34,7 @@ final class OfflineLatLonWriter implemen
final OutputStreamDataOutput out;
final long count;
private long countWritten;
+ private boolean closed;
public OfflineLatLonWriter(Path tempDir, long count) throws IOException {
tempFile = Files.createTempFile(tempDir, "size" + count + ".", "");
@@ -52,11 +53,13 @@ final class OfflineLatLonWriter implemen
@Override
public LatLonReader getReader(long start) throws IOException {
+ assert closed;
return new OfflineLatLonReader(tempFile, start, count-start);
}
@Override
public void close() throws IOException {
+ closed = true;
out.close();
if (count != countWritten) {
throw new IllegalStateException("wrote " + countWritten + " values, but expected " + count);
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/HeapSliceWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/HeapSliceWriter.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/HeapSliceWriter.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/HeapSliceWriter.java Wed Sep 2 13:06:13 2015
@@ -22,6 +22,7 @@ final class HeapSliceWriter implements S
final int[] docIDs;
final long[] ords;
private int nextWrite;
+ private boolean closed;
public HeapSliceWriter(int count) {
values = new long[count];
@@ -39,11 +40,13 @@ final class HeapSliceWriter implements S
@Override
public SliceReader getReader(long start) {
+ assert closed;
return new HeapSliceReader(values, ords, docIDs, (int) start, values.length);
}
@Override
public void close() {
+ closed = true;
if (nextWrite != values.length) {
throw new IllegalStateException("only wrote " + nextWrite + " values, but expected " + values.length);
}
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/OfflineSliceWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/OfflineSliceWriter.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/OfflineSliceWriter.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/OfflineSliceWriter.java Wed Sep 2 13:06:13 2015
@@ -33,6 +33,7 @@ final class OfflineSliceWriter implement
final ByteArrayDataOutput scratchBytesOutput = new ByteArrayDataOutput(scratchBytes);
final OutputStreamDataOutput out;
final long count;
+ private boolean closed;
private long countWritten;
public OfflineSliceWriter(Path tempDir, long count) throws IOException {
@@ -51,11 +52,13 @@ final class OfflineSliceWriter implement
@Override
public SliceReader getReader(long start) throws IOException {
+ assert closed;
return new OfflineSliceReader(tempFile, start, count-start);
}
@Override
public void close() throws IOException {
+ closed = true;
out.close();
if (count != countWritten) {
throw new IllegalStateException("wrote " + countWritten + " values, but expected " + count);
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeDocValuesProducer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeDocValuesProducer.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeDocValuesProducer.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeDocValuesProducer.java Wed Sep 2 13:06:13 2015
@@ -99,8 +99,12 @@ class RangeTreeDocValuesProducer extends
// FieldInfos checks has already ensured we are a DV field of this type, and Codec ensures
// this DVFormat was used at write time:
assert fp != null;
- datIn.seek(fp);
- treeReader = new RangeTreeReader(datIn);
+
+ // LUCENE-6697: never do real IOPs with the original IndexInput because search
+ // threads can be concurrently cloning it:
+ IndexInput clone = datIn.clone();
+ clone.seek(fp);
+ treeReader = new RangeTreeReader(clone);
// Only hang onto the reader when we are not merging:
if (merging == false) {
@@ -148,9 +152,11 @@ class RangeTreeDocValuesProducer extends
// this DVFormat was used at write time:
assert fp != null;
- datIn.seek(fp);
- //System.out.println("load field=" + field.name);
- treeReader = new RangeTreeReader(datIn);
+ // LUCENE-6697: never do real IOPs with the original IndexInput because search
+ // threads can be concurrently cloning it:
+ IndexInput clone = datIn.clone();
+ clone.seek(fp);
+ treeReader = new RangeTreeReader(clone);
// Only hang onto the reader when we are not merging:
if (merging == false) {
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java Wed Sep 2 13:06:13 2015
@@ -188,7 +188,7 @@ class RangeTreeWriter {
if (success) {
IOUtils.close(sortedWriter, reader);
} else {
- IOUtils.closeWhileHandlingException(reader);
+ IOUtils.closeWhileHandlingException(sortedWriter, reader);
try {
sortedWriter.destroy();
} catch (Throwable t) {
@@ -245,6 +245,7 @@ class RangeTreeWriter {
heapWriter.ords[i],
heapWriter.docIDs[i]);
}
+ sorted.close();
return sorted;
} else {
@@ -468,6 +469,7 @@ class RangeTreeWriter {
assert hasNext;
writer.append(reader.value(), reader.ord(), reader.docID());
}
+ writer.close();
source = new PathSlice(writer, 0, count);
}
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/test/org/apache/lucene/bkdtree/TestBKDTree.java Wed Sep 2 13:06:13 2015
@@ -169,9 +169,7 @@ public class TestBKDTree extends LuceneT
IndexWriterConfig iwc = newIndexWriterConfig();
// We rely on docID order:
iwc.setMergePolicy(newLogMergePolicy());
- int maxPointsInLeaf = TestUtil.nextInt(random(), 16, 2048);
- int maxPointsSortInHeap = TestUtil.nextInt(random(), maxPointsInLeaf, 1024*1024);
- Codec codec = TestUtil.alwaysDocValuesFormat(new BKDTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap));
+ Codec codec = TestUtil.alwaysDocValuesFormat(getDocValuesFormat());
iwc.setCodec(codec);
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -360,15 +358,13 @@ public class TestBKDTree extends LuceneT
private static final double TOLERANCE = 1e-7;
private static void verify(double[] lats, double[] lons) throws Exception {
- int maxPointsInLeaf = TestUtil.nextInt(random(), 16, 2048);
- int maxPointsSortInHeap = TestUtil.nextInt(random(), maxPointsInLeaf, 1024*1024);
IndexWriterConfig iwc = newIndexWriterConfig();
// Else we can get O(N^2) merging:
int mbd = iwc.getMaxBufferedDocs();
if (mbd != -1 && mbd < lats.length/100) {
iwc.setMaxBufferedDocs(lats.length/100);
}
- final DocValuesFormat dvFormat = new BKDTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap);
+ final DocValuesFormat dvFormat = getDocValuesFormat();
Codec codec = new Lucene53Codec() {
@Override
public DocValuesFormat getDocValuesFormatForField(String field) {
@@ -616,7 +612,7 @@ public class TestBKDTree extends LuceneT
public void testAccountableHasDelegate() throws Exception {
Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig();
- Codec codec = TestUtil.alwaysDocValuesFormat(new BKDTreeDocValuesFormat());
+ Codec codec = TestUtil.alwaysDocValuesFormat(getDocValuesFormat());
iwc.setCodec(codec);
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
Document doc = new Document();
@@ -632,4 +628,10 @@ public class TestBKDTree extends LuceneT
assertTrue(Accountables.toString((Accountable) r.leaves().get(0).reader()).contains("delegate"));
IOUtils.close(r, w, dir);
}
+
+ private static DocValuesFormat getDocValuesFormat() {
+ int maxPointsInLeaf = TestUtil.nextInt(random(), 16, 2048);
+ int maxPointsSortInHeap = TestUtil.nextInt(random(), maxPointsInLeaf, 1024*1024);
+ return new BKDTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap);
+ }
}
Modified: lucene/dev/branches/lucene6699/lucene/sandbox/src/test/org/apache/lucene/rangetree/TestRangeTree.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/sandbox/src/test/org/apache/lucene/rangetree/TestRangeTree.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/sandbox/src/test/org/apache/lucene/rangetree/TestRangeTree.java (original)
+++ lucene/dev/branches/lucene6699/lucene/sandbox/src/test/org/apache/lucene/rangetree/TestRangeTree.java Wed Sep 2 13:06:13 2015
@@ -123,9 +123,7 @@ public class TestRangeTree extends Lucen
// We rely on docID order:
iwc.setMergePolicy(newLogMergePolicy());
- int maxPointsInLeaf = TestUtil.nextInt(random(), 16, 2048);
- int maxPointsSortInHeap = TestUtil.nextInt(random(), maxPointsInLeaf, 1024*1024);
- Codec codec = TestUtil.alwaysDocValuesFormat(new RangeTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap));
+ Codec codec = TestUtil.alwaysDocValuesFormat(getDocValuesFormat());
iwc.setCodec(codec);
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -210,9 +208,7 @@ public class TestRangeTree extends Lucen
// We rely on docID order:
iwc.setMergePolicy(newLogMergePolicy());
- int maxPointsInLeaf = TestUtil.nextInt(random(), 16, 2048);
- int maxPointsSortInHeap = TestUtil.nextInt(random(), 1024, 1024*1024);
- Codec codec = TestUtil.alwaysDocValuesFormat(new RangeTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap));
+ Codec codec = TestUtil.alwaysDocValuesFormat(getDocValuesFormat());
iwc.setCodec(codec);
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
@@ -353,8 +349,6 @@ public class TestRangeTree extends Lucen
}
private static void verify(Bits missing, long[] values) throws Exception {
- int maxPointsInLeaf = TestUtil.nextInt(random(), 16, 2048);
- int maxPointsSortInHeap = TestUtil.nextInt(random(), maxPointsInLeaf, 1024*1024);
IndexWriterConfig iwc = newIndexWriterConfig();
// Else we can get O(N^2) merging:
@@ -362,7 +356,7 @@ public class TestRangeTree extends Lucen
if (mbd != -1 && mbd < values.length/100) {
iwc.setMaxBufferedDocs(values.length/100);
}
- final DocValuesFormat dvFormat = new RangeTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap);
+ final DocValuesFormat dvFormat = getDocValuesFormat();
Codec codec = new Lucene53Codec() {
@Override
public DocValuesFormat getDocValuesFormatForField(String field) {
@@ -768,4 +762,10 @@ public class TestRangeTree extends Lucen
return v ^ 0x8000000000000000L;
}
*/
+
+ private static DocValuesFormat getDocValuesFormat() {
+ int maxPointsInLeaf = TestUtil.nextInt(random(), 16, 2048);
+ int maxPointsSortInHeap = TestUtil.nextInt(random(), maxPointsInLeaf, 1024*1024);
+ return new RangeTreeDocValuesFormat(maxPointsInLeaf, maxPointsSortInHeap);
+ }
}
Modified: lucene/dev/branches/lucene6699/lucene/site/changes/changes2html.pl
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/site/changes/changes2html.pl?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/site/changes/changes2html.pl (original)
+++ lucene/dev/branches/lucene6699/lucene/site/changes/changes2html.pl Wed Sep 2 13:06:13 2015
@@ -579,19 +579,19 @@ for my $rel (@releases) {
~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 $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!<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!<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;
@@ -654,7 +654,7 @@ sub markup_trailing_attribution {
# 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.
+ # then it is considered to be an attribution.
$item =~ s{(\s+(\((?![Ss]ee\ )
(?!spans\b)
@@ -675,7 +675,7 @@ sub markup_trailing_attribution {
{
my $subst = $1; # default: no change
my $parenthetical = $2;
- my $trailing_period_and_or_issue = $3;
+ my $trailing_period_and_or_issue = $3;
if ($parenthetical !~ /LUCENE-\d+/) {
my ($no_parens) = $parenthetical =~ /^\((.*)\)$/s;
my @words = grep {/\S/} split /\s+/, $no_parens;
Modified: lucene/dev/branches/lucene6699/lucene/site/xsl/index.xsl
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/site/xsl/index.xsl?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/site/xsl/index.xsl (original)
+++ lucene/dev/branches/lucene6699/lucene/site/xsl/index.xsl Wed Sep 2 13:06:13 2015
@@ -88,8 +88,8 @@
<xsl:call-template name="modules"/>
</body>
</html>
- </xsl:template>
-
+ </xsl:template>
+
<xsl:template name="modules">
<ul>
<xsl:for-each select="str:split($buildfiles,'|')">
Modified: lucene/dev/branches/lucene6699/lucene/suggest/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/suggest/build.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/suggest/build.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/suggest/build.xml Wed Sep 2 13:06:13 2015
@@ -22,7 +22,7 @@
<description>
Auto-suggest and Spellchecking support
</description>
-
+
<!-- just a list of words for testing suggesters -->
<property name="rat.excludes" value="**/Top50KWiki.utf8,**/stop-snowball.txt"/>
@@ -40,8 +40,8 @@
<invoke-module-javadoc>
<links>
<link href="../analyzers-common"/>
- <link href="../queries"/>
- <link href="../misc"/>
+ <link href="../queries"/>
+ <link href="../misc"/>
</links>
</invoke-module-javadoc>
</target>
Modified: lucene/dev/branches/lucene6699/lucene/suggest/src/java/org/apache/lucene/search/spell/NGramDistance.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/suggest/src/java/org/apache/lucene/search/spell/NGramDistance.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/suggest/src/java/org/apache/lucene/search/spell/NGramDistance.java (original)
+++ lucene/dev/branches/lucene6699/lucene/suggest/src/java/org/apache/lucene/search/spell/NGramDistance.java Wed Sep 2 13:06:13 2015
@@ -1,6 +1,6 @@
package org.apache.lucene.search.spell;
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
Modified: lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/TestBloomFilteredLucenePostings.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/TestBloomFilteredLucenePostings.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/TestBloomFilteredLucenePostings.java (original)
+++ lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/codecs/bloom/TestBloomFilteredLucenePostings.java Wed Sep 2 13:06:13 2015
@@ -1,6 +1,6 @@
package org.apache.lucene.codecs.bloom;
-/**
+/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
Modified: lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java (original)
+++ lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/index/BaseCompoundFormatTestCase.java Wed Sep 2 13:06:13 2015
@@ -23,6 +23,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
+import java.util.Random;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.document.Document;
@@ -654,8 +655,9 @@ public abstract class BaseCompoundFormat
/** Creates a file of the specified size with random data. */
protected static void createRandomFile(Directory dir, String name, int size) throws IOException {
IndexOutput os = dir.createOutput(name, newIOContext(random()));
+ Random rnd = random();
for (int i=0; i<size; i++) {
- byte b = (byte) (Math.random() * 256);
+ byte b = (byte) rnd.nextInt(256);
os.writeByte(b);
}
os.close();
Modified: lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java (original)
+++ lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/store/BaseDirectoryTestCase.java Wed Sep 2 13:06:13 2015
@@ -1114,9 +1114,7 @@ public abstract class BaseDirectoryTestC
IndexOutput os = dir.createOutput("testBufferStart.txt", newIOContext(random()));
byte[] largeBuf = new byte[2048];
- for (int i=0; i<largeBuf.length; i++) {
- largeBuf[i] = (byte) (Math.random() * 256);
- }
+ random().nextBytes(largeBuf);
long currentPos = os.getFilePointer();
os.writeBytes(largeBuf, largeBuf.length);
Modified: lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java (original)
+++ lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/store/BaseLockFactoryTestCase.java Wed Sep 2 13:06:13 2015
@@ -17,26 +17,32 @@ package org.apache.lucene.store;
* limitations under the License.
*/
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.concurrent.CyclicBarrier;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.locks.ReentrantLock;
-
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
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.IndexWriterConfig.OpenMode;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.Term;
-import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
+import org.apache.lucene.util.Constants;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.PrintStreamInfoStream;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
+import java.nio.file.AccessDeniedException;
+import java.nio.file.Path;
+import java.util.concurrent.CyclicBarrier;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.ReentrantLock;
/** Base class for per-LockFactory tests. */
public abstract class BaseLockFactoryTestCase extends LuceneTestCase {
@@ -186,6 +192,16 @@ public abstract class BaseLockFactoryTes
this.numIteration = numIteration;
this.dir = dir;
}
+
+ private String toString(ByteArrayOutputStream baos) {
+ try {
+ return baos.toString("UTF8");
+ } catch (UnsupportedEncodingException uee) {
+ // shouldn't happen
+ throw new RuntimeException(uee);
+ }
+ }
+
@Override
public void run() {
IndexWriter writer = null;
@@ -193,8 +209,20 @@ public abstract class BaseLockFactoryTes
if (VERBOSE) {
System.out.println("TEST: WriterThread iter=" + i);
}
+
+ IndexWriterConfig iwc = new IndexWriterConfig(new MockAnalyzer(random()));
+
+ // We only print the IW infoStream output on exc, below:
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try {
+ iwc.setInfoStream(new PrintStreamInfoStream(new PrintStream(baos, true, "UTF8")));
+ } catch (UnsupportedEncodingException uee) {
+ // shouldn't happen
+ throw new RuntimeException(uee);
+ }
+ iwc.setOpenMode(OpenMode.APPEND);
try {
- writer = new IndexWriter(dir, new IndexWriterConfig(new MockAnalyzer(random())).setOpenMode(OpenMode.APPEND));
+ writer = new IndexWriter(dir, iwc);
} catch (LockObtainFailedException e) {
// lock obtain timed out
// NOTE: we should at some point
@@ -202,27 +230,37 @@ public abstract class BaseLockFactoryTes
// obtains, across IndexReader &
// IndexWriters should be "fair" (ie
// FIFO).
- } catch (Exception e) {
- hitException = true;
- System.out.println("Stress Test Index Writer: creation hit unexpected exception: " + e.toString());
- e.printStackTrace(System.out);
+ } catch (Throwable t) {
+ if (Constants.WINDOWS && t instanceof AccessDeniedException) {
+ // LUCENE-6684: suppress this: on Windows, a file in the curious "pending delete" state can
+ // cause this exc on IW init, where one thread/process deleted an old
+ // segments_N, but the delete hasn't finished yet because other threads/processes
+ // still have it open
+ } else {
+ hitException = true;
+ System.out.println("Stress Test Index Writer: creation hit unexpected exception: " + t.toString());
+ t.printStackTrace(System.out);
+ System.out.println(toString(baos));
+ }
break;
}
if (writer != null) {
try {
addDoc(writer);
- } catch (IOException e) {
+ } catch (Throwable t) {
hitException = true;
- System.out.println("Stress Test Index Writer: addDoc hit unexpected exception: " + e.toString());
- e.printStackTrace(System.out);
+ System.out.println("Stress Test Index Writer: addDoc hit unexpected exception: " + t.toString());
+ t.printStackTrace(System.out);
+ System.out.println(toString(baos));
break;
}
try {
writer.close();
- } catch (IOException e) {
+ } catch (Throwable t) {
hitException = true;
- System.out.println("Stress Test Index Writer: close hit unexpected exception: " + e.toString());
- e.printStackTrace(System.out);
+ System.out.println("Stress Test Index Writer: close hit unexpected exception: " + t.toString());
+ t.printStackTrace(System.out);
+ System.out.println(toString(baos));
break;
}
writer = null;
@@ -230,7 +268,7 @@ public abstract class BaseLockFactoryTes
}
}
}
-
+
private class SearcherThread extends Thread {
private Directory dir;
private int numIteration;
Modified: lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java Wed Sep 2 13:06:13 2015
@@ -2641,6 +2641,7 @@ public abstract class LuceneTestCase ext
* are impacted by jdk bugs. may not avoid all jdk bugs in tests.
* see https://bugs.openjdk.java.net/browse/JDK-8071862
*/
+ @SuppressForbidden(reason = "dodges JDK-8071862")
public static int collate(Collator collator, String s1, String s2) {
int v1 = collator.compare(s1, s2);
int v2 = collator.getCollationKey(s1).compareTo(collator.getCollationKey(s2));
Modified: lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java (original)
+++ lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/TestUtil.java Wed Sep 2 13:06:13 2015
@@ -1176,24 +1176,6 @@ public final class TestUtil {
}
}
- /**
- * Returns a random string in the specified length range consisting
- * entirely of whitespace characters
- * @see #WHITESPACE_CHARACTERS
- */
- public static String randomWhitespace(Random r, int minLength, int maxLength) {
- final int end = nextInt(r, minLength, maxLength);
- StringBuilder out = new StringBuilder();
- for (int i = 0; i < end; i++) {
- int offset = nextInt(r, 0, WHITESPACE_CHARACTERS.length-1);
- char c = WHITESPACE_CHARACTERS[offset];
- // sanity check
- Assert.assertTrue("Not really whitespace? (@"+offset+"): " + c, Character.isWhitespace(c));
- out.append(c);
- }
- return out.toString();
- }
-
public static String randomAnalysisString(Random random, int maxLength, boolean simple) {
assert maxLength >= 0;
@@ -1293,36 +1275,4 @@ public final class TestUtil {
}
return ram;
}
-
- /** List of characters that match {@link Character#isWhitespace} */
- public static final char[] WHITESPACE_CHARACTERS = new char[] {
- // :TODO: is this list exhaustive?
- '\u0009',
- '\n',
- '\u000B',
- '\u000C',
- '\r',
- '\u001C',
- '\u001D',
- '\u001E',
- '\u001F',
- '\u0020',
- // '\u0085', faild sanity check?
- '\u1680',
- '\u180E',
- '\u2000',
- '\u2001',
- '\u2002',
- '\u2003',
- '\u2004',
- '\u2005',
- '\u2006',
- '\u2008',
- '\u2009',
- '\u200A',
- '\u2028',
- '\u2029',
- '\u205F',
- '\u3000',
- };
}
Modified: lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java (original)
+++ lucene/dev/branches/lucene6699/lucene/test-framework/src/java/org/apache/lucene/util/automaton/AutomatonTestUtil.java Wed Sep 2 13:06:13 2015
@@ -256,19 +256,26 @@ public class AutomatonTestUtil {
return ArrayUtil.toIntArray(soFar);
}
}
+
+ private static Automaton randomSingleAutomaton(Random random) {
+ while (true) {
+ try {
+ Automaton a1 = new RegExp(AutomatonTestUtil.randomRegexp(random), RegExp.NONE).toAutomaton();
+ if (random.nextBoolean()) {
+ a1 = Operations.complement(a1, DEFAULT_MAX_DETERMINIZED_STATES);
+ }
+ return a1;
+ } catch (TooComplexToDeterminizeException tctde) {
+ // This can (rarely) happen if the random regexp is too hard; just try again...
+ }
+ }
+ }
/** return a random NFA/DFA for testing */
public static Automaton randomAutomaton(Random random) {
// get two random Automata from regexps
- Automaton a1 = new RegExp(AutomatonTestUtil.randomRegexp(random), RegExp.NONE).toAutomaton();
- if (random.nextBoolean()) {
- a1 = Operations.complement(a1, DEFAULT_MAX_DETERMINIZED_STATES);
- }
-
- Automaton a2 = new RegExp(AutomatonTestUtil.randomRegexp(random), RegExp.NONE).toAutomaton();
- if (random.nextBoolean()) {
- a2 = Operations.complement(a2, DEFAULT_MAX_DETERMINIZED_STATES);
- }
+ Automaton a1 = randomSingleAutomaton(random);
+ Automaton a2 = randomSingleAutomaton(random);
// combine them in random ways
switch (random.nextInt(4)) {
Modified: lucene/dev/branches/lucene6699/lucene/tools/custom-tasks.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/tools/custom-tasks.xml?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/tools/custom-tasks.xml (original)
+++ lucene/dev/branches/lucene6699/lucene/tools/custom-tasks.xml Wed Sep 2 13:06:13 2015
@@ -89,7 +89,8 @@
<attribute name="dir"/>
<attribute name="centralized.versions.file"/>
<attribute name="ivy.settings.file"/>
- <attribute name="ivy.resolution-cache.dir"/>
+ <attribute name="ivy.resolution-cache.dir"/>
+ <attribute name="ivy.lock-strategy"/>
<attribute name="common.build.dir"/>
<attribute name="ignore.conflicts.file"/>
<sequential>
@@ -101,7 +102,8 @@
<echo>Lib versions check under: @{dir}</echo>
<libversions centralizedVersionsFile="@{centralized.versions.file}"
ivySettingsFile="@{ivy.settings.file}"
- ivyResolutionCacheDir="@{ivy.resolution-cache.dir}"
+ ivyResolutionCacheDir="@{ivy.resolution-cache.dir}"
+ ivyLockStrategy="@{ivy.lock-strategy}"
commonBuildDir="@{common.build.dir}"
ignoreConflictsFile="@{ignore.conflicts.file}">
<fileset dir="@{dir}">
Modified: lucene/dev/branches/lucene6699/lucene/tools/forbiddenApis/tests.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/tools/forbiddenApis/tests.txt?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/tools/forbiddenApis/tests.txt (original)
+++ lucene/dev/branches/lucene6699/lucene/tools/forbiddenApis/tests.txt Wed Sep 2 13:06:13 2015
@@ -15,10 +15,15 @@
junit.framework.TestCase @ All classes should derive from LuceneTestCase
-java.util.Random#<init>() @ Use RandomizedRunner's random instead
+java.util.Random#<init>() @ Use RandomizedRunner's random() instead
+java.lang.Math#random() @ Use RandomizedRunner's random().nextDouble() instead
# TODO: fix tests that do this!
#java.lang.System#currentTimeMillis() @ Don't depend on wall clock times
#java.lang.System#nanoTime() @ Don't depend on wall clock times
com.carrotsearch.randomizedtesting.annotations.Seed @ Don't commit hardcoded seeds
+
+@defaultMessage Use LuceneTestCase.collate instead, which can avoid JDK-8071862
+java.text.Collator#compare(java.lang.Object,java.lang.Object)
+java.text.Collator#compare(java.lang.String,java.lang.String)
Modified: lucene/dev/branches/lucene6699/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java (original)
+++ lucene/dev/branches/lucene6699/lucene/tools/src/java/org/apache/lucene/dependencies/GetMavenDependenciesTask.java Wed Sep 2 13:06:13 2015
@@ -443,13 +443,13 @@ public class GetMavenDependenciesTask ex
} catch (IOException e) {
throw new BuildException("Exception reading centralized versions file " + centralizedVersionsFile.getPath(), e);
}
- SortedSet<Map.Entry> sortedEntries = new TreeSet<>(new Comparator<Map.Entry>() {
- @Override public int compare(Map.Entry o1, Map.Entry o2) {
+ SortedSet<Map.Entry<?,?>> sortedEntries = new TreeSet<>(new Comparator<Map.Entry<?,?>>() {
+ @Override public int compare(Map.Entry<?,?> o1, Map.Entry<?,?> o2) {
return ((String)o1.getKey()).compareTo((String)o2.getKey());
}
});
sortedEntries.addAll(versions.entrySet());
- for (Map.Entry entry : sortedEntries) {
+ for (Map.Entry<?,?> entry : sortedEntries) {
String key = (String)entry.getKey();
Matcher matcher = COORDINATE_KEY_PATTERN.matcher(key);
if (matcher.lookingAt()) {
@@ -526,7 +526,7 @@ public class GetMavenDependenciesTask ex
}
Map<String,SortedSet<String>> testScopeDependencies = new HashMap<>();
Map<String, String> testScopePropertyKeys = new HashMap<>();
- for (Map.Entry entry : moduleDependencies.entrySet()) {
+ for (Map.Entry<?,?> entry : moduleDependencies.entrySet()) {
String newPropertyKey = (String)entry.getKey();
StringBuilder newPropertyValue = new StringBuilder();
String value = (String)entry.getValue();
Modified: lucene/dev/branches/lucene6699/lucene/tools/src/java/org/apache/lucene/dependencies/InterpolatedProperties.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene6699/lucene/tools/src/java/org/apache/lucene/dependencies/InterpolatedProperties.java?rev=1700800&r1=1700799&r2=1700800&view=diff
==============================================================================
--- lucene/dev/branches/lucene6699/lucene/tools/src/java/org/apache/lucene/dependencies/InterpolatedProperties.java (original)
+++ lucene/dev/branches/lucene6699/lucene/tools/src/java/org/apache/lucene/dependencies/InterpolatedProperties.java Wed Sep 2 13:06:13 2015
@@ -56,7 +56,7 @@ public class InterpolatedProperties exte
*/
private void interpolate() {
StringBuffer buffer = new StringBuffer();
- for (Map.Entry entry : entrySet()) {
+ for (Map.Entry<?,?> entry : entrySet()) {
buffer.setLength(0);
Matcher matcher = PROPERTY_REFERENCE_PATTERN.matcher(entry.getValue().toString());
while (matcher.find()) {