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/10/25 15:10:51 UTC
svn commit: r1402140 [11/17] - in /lucene/dev/branches/LUCENE-2878: ./
dev-tools/ dev-tools/eclipse/ dev-tools/eclipse/dot.settings/
dev-tools/idea/.idea/libraries/ dev-tools/idea/lucene/classification/
dev-tools/maven/ dev-tools/maven/lucene/classific...
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/TokenSources.java Thu Oct 25 13:10:25 2012
@@ -20,28 +20,26 @@ package org.apache.lucene.search.highlig
* limitations under the License.
*/
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Comparator;
-
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.Token;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
-import org.apache.lucene.document.Document;
import org.apache.lucene.index.DocsAndPositionsEnum;
import org.apache.lucene.index.Fields;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.StoredDocument;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
-import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.BytesRef;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Comparator;
+
/**
* Hides implementation issues associated with obtaining a TokenStream for use
* with the higlighter - can obtain from TermFreqVectors with offsets and
@@ -93,12 +91,8 @@ public class TokenSources {
* minimal (1000 invocations still registers 0 ms). So this "lazy" (flexible?)
* approach to coding is probably acceptable
*
- * @param reader
- * @param docId
- * @param field
- * @param analyzer
* @return null if field not stored correctly
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public static TokenStream getAnyTokenStream(IndexReader reader, int docId,
String field, Analyzer analyzer) throws IOException {
@@ -125,14 +119,10 @@ public class TokenSources {
return getTokenStream(vector, false);
}
- private static boolean hasPositions(Terms vector) throws IOException {
- return vector.hasPositions();
- }
-
/**
- * Low level api. Returns a token stream or null if no offset info available
- * in index. This can be used to feed the highlighter with a pre-parsed token
- * stream
+ * Low level api. Returns a token stream generated from a {@link Terms}. This
+ * can be used to feed the highlighter with a pre-parsed token
+ * stream. The {@link Terms} must have offsets available.
*
* In my tests the speeds to recreate 1000 token streams using this method
* are: - with TermVector offset only data stored - 420 milliseconds - with
@@ -150,15 +140,21 @@ public class TokenSources {
* compression (less disk IO) or slower (more CPU burn) depending on the
* content.
*
- * @param tpv
* @param tokenPositionsGuaranteedContiguous true if the token position
* numbers have no overlaps or gaps. If looking to eek out the last
* drops of performance, set to true. If in doubt, set to false.
+ *
+ * @throws IllegalArgumentException if no offsets are available
*/
public static TokenStream getTokenStream(Terms tpv,
boolean tokenPositionsGuaranteedContiguous)
throws IOException {
- if (!tokenPositionsGuaranteedContiguous && hasPositions(tpv)) {
+
+ if (!tpv.hasOffsets()) {
+ throw new IllegalArgumentException("Cannot create TokenStream from Terms without offsets");
+ }
+
+ if (!tokenPositionsGuaranteedContiguous && tpv.hasPositions()) {
return new TokenStreamFromTermPositionVector(tpv);
}
@@ -266,24 +262,31 @@ public class TokenSources {
return new StoredTokenStream(tokensInOriginalOrder);
}
- public static TokenStream getTokenStream(IndexReader reader, int docId,
- String field) throws IOException {
+ /**
+ * Returns a {@link TokenStream} with positions and offsets constructed from
+ * field termvectors. If the field has no termvectors, or positions or offsets
+ * are not included in the termvector, return null.
+ * @param reader the {@link IndexReader} to retrieve term vectors from
+ * @param docId the document to retrieve termvectors for
+ * @param field the field to retrieve termvectors for
+ * @return a {@link TokenStream}, or null if positions and offsets are not available
+ * @throws IOException If there is a low-level I/O error
+ */
+ public static TokenStream getTokenStreamWithOffsets(IndexReader reader, int docId,
+ String field) throws IOException {
Fields vectors = reader.getTermVectors(docId);
if (vectors == null) {
- throw new IllegalArgumentException(field + " in doc #" + docId
- + "does not have any term position data stored");
+ return null;
}
Terms vector = vectors.terms(field);
if (vector == null) {
- throw new IllegalArgumentException(field + " in doc #" + docId
- + "does not have any term position data stored");
+ return null;
}
- if (!hasPositions(vector)) {
- throw new IllegalArgumentException(field + " in doc #" + docId
- + "does not have any term position data stored");
+ if (!vector.hasPositions() || !vector.hasOffsets()) {
+ return null;
}
return getTokenStream(vector);
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTerm.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTerm.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTerm.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTerm.java Thu Oct 25 13:10:25 2012
@@ -30,20 +30,11 @@ public class WeightedSpanTerm extends We
boolean positionSensitive;
private List<PositionSpan> positionSpans = new ArrayList<PositionSpan>();
- /**
- * @param weight
- * @param term
- */
public WeightedSpanTerm(float weight, String term) {
super(weight, term);
this.positionSpans = new ArrayList<PositionSpan>();
}
- /**
- * @param weight
- * @param term
- * @param positionSensitive
- */
public WeightedSpanTerm(float weight, String term, boolean positionSensitive) {
super(weight, term);
this.positionSensitive = positionSensitive;
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/highlight/WeightedSpanTermExtractor.java Thu Oct 25 13:10:25 2012
@@ -88,7 +88,7 @@ public class WeightedSpanTermExtractor {
* Query to extract Terms from
* @param terms
* Map to place created WeightedSpanTerms in
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
protected void extract(Query query, Map<String,WeightedSpanTerm> terms) throws IOException {
if (query instanceof BooleanQuery) {
@@ -141,6 +141,11 @@ public class WeightedSpanTermExtractor {
extractWeightedSpanTerms(terms, (SpanQuery) query);
} else if (query instanceof FilteredQuery) {
extract(((FilteredQuery) query).getQuery(), terms);
+ } else if (query instanceof ConstantScoreQuery) {
+ final Query q = ((ConstantScoreQuery) query).getQuery();
+ if (q != null) {
+ extract(q, terms);
+ }
} else if (query instanceof DisjunctionMaxQuery) {
for (Iterator<Query> iterator = ((DisjunctionMaxQuery) query).iterator(); iterator.hasNext();) {
extract(iterator.next(), terms);
@@ -221,7 +226,7 @@ public class WeightedSpanTermExtractor {
* Map to place created WeightedSpanTerms in
* @param spanQuery
* SpanQuery to extract Terms from
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
protected void extractWeightedSpanTerms(Map<String,WeightedSpanTerm> terms, SpanQuery spanQuery) throws IOException {
Set<String> fieldNames;
@@ -309,7 +314,7 @@ public class WeightedSpanTermExtractor {
* Map to place created WeightedSpanTerms in
* @param query
* Query to extract Terms from
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
protected void extractWeightedTerms(Map<String,WeightedSpanTerm> terms, Query query) throws IOException {
Set<Term> nonWeightedTerms = new HashSet<Term>();
@@ -362,7 +367,7 @@ public class WeightedSpanTermExtractor {
* @param tokenStream
* of text to be highlighted
* @return Map containing WeightedSpanTerms
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public Map<String,WeightedSpanTerm> getWeightedSpanTerms(Query query, TokenStream tokenStream)
throws IOException {
@@ -381,7 +386,7 @@ public class WeightedSpanTermExtractor {
* @param fieldName
* restricts Term's used based on field name
* @return Map containing WeightedSpanTerms
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public Map<String,WeightedSpanTerm> getWeightedSpanTerms(Query query, TokenStream tokenStream,
String fieldName) throws IOException {
@@ -417,7 +422,7 @@ public class WeightedSpanTermExtractor {
* @param reader
* to use for scoring
* @return Map of WeightedSpanTerms with quasi tf/idf scores
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public Map<String,WeightedSpanTerm> getWeightedSpanTermsWithScores(Query query, TokenStream tokenStream, String fieldName,
IndexReader reader) throws IOException {
@@ -551,8 +556,6 @@ public class WeightedSpanTermExtractor {
* ensure an efficient reset - if you are already using a different caching
* {@link TokenStream} impl and you don't want it to be wrapped, set this to
* false.
- *
- * @param wrap
*/
public void setWrapIfNotCachingTokenFilter(boolean wrap) {
this.wrapToCaching = wrap;
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragListBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragListBuilder.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragListBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragListBuilder.java Thu Oct 25 13:10:25 2012
@@ -69,13 +69,14 @@ public abstract class BaseFragListBuilde
wpil.clear();
wpil.add( phraseInfo );
+ int firstOffset = phraseInfo.getStartOffset();
int st = phraseInfo.getStartOffset() - margin < startOffset ?
startOffset : phraseInfo.getStartOffset() - margin;
int en = st + fragCharSize;
if( phraseInfo.getEndOffset() > en )
en = phraseInfo.getEndOffset();
- startOffset = en;
+ int lastEndOffset = phraseInfo.getEndOffset();
while( true ){
if( ite.hasNext() ){
phraseInfo = ite.next();
@@ -84,11 +85,22 @@ public abstract class BaseFragListBuilde
}
else
break;
- if( phraseInfo.getEndOffset() <= en )
+ if( phraseInfo.getEndOffset() <= en ){
wpil.add( phraseInfo );
+ lastEndOffset = phraseInfo.getEndOffset();
+ }
else
break;
}
+ int matchLen = lastEndOffset - firstOffset;
+ //now recalculate the start and end position to "center" the result
+ int newMargin = (fragCharSize-matchLen)/2;
+ st = firstOffset - newMargin;
+ if(st<startOffset){
+ st = startOffset;
+ }
+ en = st+fragCharSize;
+ startOffset = en;
fieldFragList.add( st, en, wpil );
}
return fieldFragList;
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FastVectorHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FastVectorHighlighter.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FastVectorHighlighter.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FastVectorHighlighter.java Thu Oct 25 13:10:25 2012
@@ -106,7 +106,7 @@ public class FastVectorHighlighter {
* @param fieldName field of the document to be highlighted
* @param fragCharSize the length (number of chars) of a fragment
* @return the best fragment (snippet) string
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public final String getBestFragment( final FieldQuery fieldQuery, IndexReader reader, int docId,
String fieldName, int fragCharSize ) throws IOException {
@@ -126,7 +126,7 @@ public class FastVectorHighlighter {
* @param maxNumFragments maximum number of fragments
* @return created fragments or null when no fragments created.
* size of the array can be less than maxNumFragments
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public final String[] getBestFragments( final FieldQuery fieldQuery, IndexReader reader, int docId,
String fieldName, int fragCharSize, int maxNumFragments ) throws IOException {
@@ -149,7 +149,7 @@ public class FastVectorHighlighter {
* @param postTags post-tags to be used to highlight terms
* @param encoder an encoder that generates encoded text
* @return the best fragment (snippet) string
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public final String getBestFragment( final FieldQuery fieldQuery, IndexReader reader, int docId,
String fieldName, int fragCharSize,
@@ -175,7 +175,7 @@ public class FastVectorHighlighter {
* @param encoder an encoder that generates encoded text
* @return created fragments or null when no fragments created.
* size of the array can be less than maxNumFragments
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public final String[] getBestFragments( final FieldQuery fieldQuery, IndexReader reader, int docId,
String fieldName, int fragCharSize, int maxNumFragments,
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldQuery.java Thu Oct 25 13:10:25 2012
@@ -292,8 +292,6 @@ public class FieldQuery {
/**
*
- * @param fieldName
- * @param term
* @return QueryPhraseMap
*/
public QueryPhraseMap getFieldTermMap( String fieldName, String term ){
@@ -303,8 +301,6 @@ public class FieldQuery {
/**
*
- * @param fieldName
- * @param phraseCandidate
* @return QueryPhraseMap
*/
public QueryPhraseMap searchPhrase( String fieldName, final List<TermInfo> phraseCandidate ){
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java Thu Oct 25 13:10:25 2012
@@ -70,7 +70,7 @@ public class FieldTermStack {
* @param docId document id to be highlighted
* @param fieldName field of the document to be highlighted
* @param fieldQuery FieldQuery object
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public FieldTermStack( IndexReader reader, int docId, String fieldName, final FieldQuery fieldQuery ) throws IOException {
this.fieldName = fieldName;
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FragmentsBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FragmentsBuilder.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FragmentsBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/FragmentsBuilder.java Thu Oct 25 13:10:25 2012
@@ -37,7 +37,7 @@ public interface FragmentsBuilder {
* @param fieldName field of the document to be highlighted
* @param fieldFragList FieldFragList object
* @return a created fragment or null when no fragment created
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public String createFragment( IndexReader reader, int docId, String fieldName,
FieldFragList fieldFragList ) throws IOException;
@@ -52,7 +52,7 @@ public interface FragmentsBuilder {
* @param maxNumFragments maximum number of fragments
* @return created fragments or null when no fragments created.
* size of the array can be less than maxNumFragments
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public String[] createFragments( IndexReader reader, int docId, String fieldName,
FieldFragList fieldFragList, int maxNumFragments ) throws IOException;
@@ -68,7 +68,7 @@ public interface FragmentsBuilder {
* @param postTags post-tags to be used to highlight terms
* @param encoder an encoder that generates encoded text
* @return a created fragment or null when no fragment created
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public String createFragment( IndexReader reader, int docId, String fieldName,
FieldFragList fieldFragList, String[] preTags, String[] postTags,
@@ -87,7 +87,7 @@ public interface FragmentsBuilder {
* @param encoder an encoder that generates encoded text
* @return created fragments or null when no fragments created.
* size of the array can be less than maxNumFragments
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public String[] createFragments( IndexReader reader, int docId, String fieldName,
FieldFragList fieldFragList, int maxNumFragments, String[] preTags, String[] postTags,
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java Thu Oct 25 13:10:25 2012
@@ -153,7 +153,6 @@ public class HighlighterTest extends Bas
/**
* This method intended for use with <tt>testHighlightingWithDefaultField()</tt>
- * @throws InvalidTokenOffsetsException
*/
private String highlightField(Query query, String fieldName, String text)
throws IOException, InvalidTokenOffsetsException {
@@ -604,7 +603,7 @@ public class HighlighterTest extends Bas
// Not sure we can assert anything here - just running to check we dont
// throw any exceptions
}
-
+
public void testSpanHighlighting() throws Exception {
Query query1 = new SpanNearQuery(new SpanQuery[] {
new SpanTermQuery(new Term(FIELD_NAME, "wordx")),
@@ -664,6 +663,31 @@ public class HighlighterTest extends Bas
helper.start();
}
+
+ public void testGetBestFragmentsConstantScore() throws Exception {
+ TestHighlightRunner helper = new TestHighlightRunner() {
+
+ @Override
+ public void run() throws Exception {
+ numHighlights = 0;
+ if (random().nextBoolean()) {
+ BooleanQuery bq = new BooleanQuery();
+ bq.add(new ConstantScoreQuery(new QueryWrapperFilter(new TermQuery(
+ new Term(FIELD_NAME, "kennedy")))), Occur.MUST);
+ bq.add(new ConstantScoreQuery(new TermQuery(new Term(FIELD_NAME, "kennedy"))), Occur.MUST);
+ doSearching(bq);
+ } else {
+ doSearching(new ConstantScoreQuery(new TermQuery(new Term(FIELD_NAME,
+ "kennedy"))));
+ }
+ doStandardHighlights(analyzer, searcher, hits, query, HighlighterTest.this);
+ assertTrue("Failed to find correct number of highlights " + numHighlights + " found",
+ numHighlights == 4);
+ }
+ };
+
+ helper.start();
+ }
public void testGetFuzzyFragments() throws Exception {
TestHighlightRunner helper = new TestHighlightRunner() {
@@ -1335,8 +1359,6 @@ public class HighlighterTest extends Bas
/**
* Demonstrates creation of an XHTML compliant doc using new encoding facilities.
- *
- * @throws Exception
*/
public void testEncoding() throws Exception {
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/TokenSourcesTest.java Thu Oct 25 13:10:25 2012
@@ -17,8 +17,6 @@ package org.apache.lucene.search.highlig
* limitations under the License.
*/
-import java.io.IOException;
-
import org.apache.lucene.analysis.Token;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
@@ -42,6 +40,8 @@ import org.apache.lucene.search.spans.Sp
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
+import java.io.IOException;
+
// LUCENE-2874
public class TokenSourcesTest extends LuceneTestCase {
private static final String FIELD = "text";
@@ -260,4 +260,40 @@ public class TokenSourcesTest extends Lu
}
}
+ public void testTermVectorWithoutOffsetsThrowsException()
+ throws IOException, InvalidTokenOffsetsException {
+ final String TEXT = "the fox did not jump";
+ final Directory directory = newDirectory();
+ final IndexWriter indexWriter = new IndexWriter(directory,
+ newIndexWriterConfig(TEST_VERSION_CURRENT, null));
+ try {
+ final Document document = new Document();
+ FieldType customType = new FieldType(TextField.TYPE_NOT_STORED);
+ customType.setStoreTermVectors(true);
+ customType.setStoreTermVectorOffsets(false);
+ customType.setStoreTermVectorPositions(true);
+ document.add(new Field(FIELD, new OverlappingTokenStream(), customType));
+ indexWriter.addDocument(document);
+ } finally {
+ indexWriter.close();
+ }
+ final IndexReader indexReader = DirectoryReader.open(directory);
+ try {
+ assertEquals(1, indexReader.numDocs());
+ final TokenStream tokenStream = TokenSources
+ .getTokenStream(
+ indexReader.getTermVector(0, FIELD),
+ false);
+ fail("TokenSources.getTokenStream should throw IllegalArgumentException if term vector has no offsets");
+ }
+ catch (IllegalArgumentException e) {
+ // expected
+ }
+ finally {
+ indexReader.close();
+ directory.close();
+ }
+ }
+
+
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/custom/HighlightCustomQueryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/custom/HighlightCustomQueryTest.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/custom/HighlightCustomQueryTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/custom/HighlightCustomQueryTest.java Thu Oct 25 13:10:25 2012
@@ -85,8 +85,6 @@ public class HighlightCustomQueryTest ex
/**
* This method intended for use with
* <tt>testHighlightingWithDefaultField()</tt>
- *
- * @throws InvalidTokenOffsetsException
*/
private String highlightField(Query query, String fieldName,
String text) throws IOException, InvalidTokenOffsetsException {
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/positions/IntervalHighlighterTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/positions/IntervalHighlighterTest.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/positions/IntervalHighlighterTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/highlight/positions/IntervalHighlighterTest.java Thu Oct 25 13:10:25 2012
@@ -15,16 +15,19 @@ package org.apache.lucene.search.highlig
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+import java.io.IOException;
+import java.io.StringReader;
+
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenFilter;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.codecs.Codec;
-import org.apache.lucene.codecs.lucene40.Lucene40PostingsFormat;
+import org.apache.lucene.codecs.lucene41.Lucene41PostingsFormat;
import org.apache.lucene.codecs.memory.MemoryPostingsFormat;
import org.apache.lucene.codecs.nestedpulsing.NestedPulsingPostingsFormat;
-import org.apache.lucene.codecs.pulsing.Pulsing40PostingsFormat;
+import org.apache.lucene.codecs.pulsing.Pulsing41PostingsFormat;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
@@ -50,19 +53,16 @@ import org.apache.lucene.search.highligh
import org.apache.lucene.search.highlight.SimpleFragmenter;
import org.apache.lucene.search.highlight.TextFragment;
import org.apache.lucene.search.positions.BlockIntervalIterator;
-import org.apache.lucene.search.positions.NonOverlappingQuery;
import org.apache.lucene.search.positions.IntervalFilterQuery;
import org.apache.lucene.search.positions.IntervalIterator;
import org.apache.lucene.search.positions.IntervalFilter;
+import org.apache.lucene.search.positions.NonOverlappingQuery;
import org.apache.lucene.search.positions.OrderedNearQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util._TestUtil;
import org.junit.Ignore;
-import java.io.IOException;
-import java.io.StringReader;
-
/**
* TODO: FIX THIS TEST Phrase and Span Queries positions callback API
*/
@@ -88,10 +88,10 @@ public class IntervalHighlighterTest ext
if (codecName.equals("Lucene40")) {
// Sep etc are not implemented
switch(random().nextInt(4)) {
- case 0: iwc.setCodec(_TestUtil.alwaysPostingsFormat(new Lucene40PostingsFormat())); break;
+ case 0: iwc.setCodec(_TestUtil.alwaysPostingsFormat(new Lucene41PostingsFormat())); break;
case 1: iwc.setCodec(_TestUtil.alwaysPostingsFormat(new MemoryPostingsFormat())); break;
case 2: iwc.setCodec(_TestUtil.alwaysPostingsFormat(
- new Pulsing40PostingsFormat(_TestUtil.nextInt(random(), 1, 3)))); break;
+ new Pulsing41PostingsFormat(_TestUtil.nextInt(random(), 1, 3)))); break;
case 3: iwc.setCodec(_TestUtil.alwaysPostingsFormat(new NestedPulsingPostingsFormat())); break;
}
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragListBuilderTest.java Thu Oct 25 13:10:25 2012
@@ -42,7 +42,7 @@ public class SimpleFragListBuilderTest e
SimpleFragListBuilder sflb = new SimpleFragListBuilder();
FieldFragList ffl = sflb.createFieldFragList( fpl(new TermQuery(new Term(F, "abcdefghijklmnopqrs")), "abcdefghijklmnopqrs" ), sflb.minFragCharSize );
assertEquals( 1, ffl.getFragInfos().size() );
- assertEquals( "subInfos=(abcdefghijklmnopqrs((0,19)))/1.0(0,19)", ffl.getFragInfos().get( 0 ).toString() );
+ assertEquals( "subInfos=(abcdefghijklmnopqrs((0,19)))/1.0(0,18)", ffl.getFragInfos().get( 0 ).toString() );
}
public void testSmallerFragSizeThanPhraseQuery() throws Exception {
@@ -55,7 +55,7 @@ public class SimpleFragListBuilderTest e
FieldFragList ffl = sflb.createFieldFragList( fpl(phraseQuery, "abcdefgh jklmnopqrs" ), sflb.minFragCharSize );
assertEquals( 1, ffl.getFragInfos().size() );
if (VERBOSE) System.out.println( ffl.getFragInfos().get( 0 ).toString() );
- assertEquals( "subInfos=(abcdefghjklmnopqrs((0,21)))/1.0(0,21)", ffl.getFragInfos().get( 0 ).toString() );
+ assertEquals( "subInfos=(abcdefghjklmnopqrs((0,21)))/1.0(1,19)", ffl.getFragInfos().get( 0 ).toString() );
}
public void test1TermIndex() throws Exception {
@@ -77,7 +77,7 @@ public class SimpleFragListBuilderTest e
ffl = sflb.createFieldFragList( fpl(new TermQuery(new Term(F, "a")), "b b b b a b b b b a" ), 20 );
assertEquals( 1, ffl.getFragInfos().size() );
- assertEquals( "subInfos=(a((8,9))a((18,19)))/2.0(2,22)", ffl.getFragInfos().get( 0 ).toString() );
+ assertEquals( "subInfos=(a((8,9))a((18,19)))/2.0(4,24)", ffl.getFragInfos().get( 0 ).toString() );
}
public void test2TermsIndex2Frags() throws Exception {
@@ -85,7 +85,7 @@ public class SimpleFragListBuilderTest e
FieldFragList ffl = sflb.createFieldFragList( fpl(new TermQuery(new Term(F, "a")), "a b b b b b b b b b b b b b a" ), 20 );
assertEquals( 2, ffl.getFragInfos().size() );
assertEquals( "subInfos=(a((0,1)))/1.0(0,20)", ffl.getFragInfos().get( 0 ).toString() );
- assertEquals( "subInfos=(a((28,29)))/1.0(22,42)", ffl.getFragInfos().get( 1 ).toString() );
+ assertEquals( "subInfos=(a((28,29)))/1.0(20,40)", ffl.getFragInfos().get( 1 ).toString() );
ffl = sflb.createFieldFragList( fpl(new TermQuery(new Term(F, "a")), "a b b b b b b b b b b b b a" ), 20 );
assertEquals( 2, ffl.getFragInfos().size() );
@@ -164,7 +164,7 @@ public class SimpleFragListBuilderTest e
SimpleFragListBuilder sflb = new SimpleFragListBuilder();
FieldFragList ffl = sflb.createFieldFragList( fpl, 100 );
assertEquals( 1, ffl.getFragInfos().size() );
- assertEquals( "subInfos=(d((9,10)))/1.0(3,103)", ffl.getFragInfos().get( 0 ).toString() );
+ assertEquals( "subInfos=(d((9,10)))/1.0(0,100)", ffl.getFragInfos().get( 0 ).toString() );
}
public void test1PhraseLongMV() throws Exception {
@@ -176,7 +176,7 @@ public class SimpleFragListBuilderTest e
SimpleFragListBuilder sflb = new SimpleFragListBuilder();
FieldFragList ffl = sflb.createFieldFragList( fpl, 100 );
assertEquals( 1, ffl.getFragInfos().size() );
- assertEquals( "subInfos=(searchengines((102,116))searchengines((157,171)))/2.0(96,196)", ffl.getFragInfos().get( 0 ).toString() );
+ assertEquals( "subInfos=(searchengines((102,116))searchengines((157,171)))/2.0(87,187)", ffl.getFragInfos().get( 0 ).toString() );
}
public void test1PhraseLongMVB() throws Exception {
@@ -188,6 +188,6 @@ public class SimpleFragListBuilderTest e
SimpleFragListBuilder sflb = new SimpleFragListBuilder();
FieldFragList ffl = sflb.createFieldFragList( fpl, 100 );
assertEquals( 1, ffl.getFragInfos().size() );
- assertEquals( "subInfos=(sppeeeed((88,93)))/1.0(82,182)", ffl.getFragInfos().get( 0 ).toString() );
+ assertEquals( "subInfos=(sppeeeed((88,93)))/1.0(41,141)", ffl.getFragInfos().get( 0 ).toString() );
}
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java Thu Oct 25 13:10:25 2012
@@ -106,7 +106,8 @@ public class SimpleFragmentsBuilderTest
SimpleFragListBuilder sflb = new SimpleFragListBuilder();
FieldFragList ffl = sflb.createFieldFragList( fpl, 100 );
SimpleFragmentsBuilder sfb = new SimpleFragmentsBuilder();
- assertEquals( "a b c <b>d</b> e", sfb.createFragment( reader, 0, F, ffl ) );
+ // Should we probably be trimming?
+ assertEquals( " a b c <b>d</b> e", sfb.createFragment( reader, 0, F, ffl ) );
}
public void test1PhraseLongMV() throws Exception {
@@ -118,7 +119,7 @@ public class SimpleFragmentsBuilderTest
SimpleFragListBuilder sflb = new SimpleFragListBuilder();
FieldFragList ffl = sflb.createFieldFragList( fpl, 100 );
SimpleFragmentsBuilder sfb = new SimpleFragmentsBuilder();
- assertEquals( "The most <b>search engines</b> use only one of these methods. Even the <b>search engines</b> that says they can use the",
+ assertEquals( "customization: The most <b>search engines</b> use only one of these methods. Even the <b>search engines</b> that says they can",
sfb.createFragment( reader, 0, F, ffl ) );
}
@@ -131,7 +132,7 @@ public class SimpleFragmentsBuilderTest
SimpleFragListBuilder sflb = new SimpleFragListBuilder();
FieldFragList ffl = sflb.createFieldFragList( fpl, 100 );
SimpleFragmentsBuilder sfb = new SimpleFragmentsBuilder();
- assertEquals( "processing <b>speed</b>, the", sfb.createFragment( reader, 0, F, ffl ) );
+ assertEquals( "additional hardware. \nWhen you talk about processing <b>speed</b>, the", sfb.createFragment( reader, 0, F, ffl ) );
}
public void testUnstoredField() throws Exception {
@@ -209,7 +210,7 @@ public class SimpleFragmentsBuilderTest
String[] result = sfb.createFragments(reader, 0, F, ffl, 3);
assertEquals(2, result.length);
assertEquals("some <b>text</b> to highlight", result[0]);
- assertEquals("other <b>text</b>", result[1]);
+ assertEquals("highlight other <b>text</b>", result[1]);
fq = new FieldQuery( tq( "highlight" ), true, true );
stack = new FieldTermStack( reader, 0, F, fq );
Modified: lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/WeightedFragListBuilderTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/WeightedFragListBuilderTest.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/WeightedFragListBuilderTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/highlighter/src/test/org/apache/lucene/search/vectorhighlight/WeightedFragListBuilderTest.java Thu Oct 25 13:10:25 2012
@@ -29,7 +29,7 @@ public class WeightedFragListBuilderTest
WeightedFragListBuilder wflb = new WeightedFragListBuilder();
FieldFragList ffl = wflb.createFieldFragList( fpl, 100 );
assertEquals( 1, ffl.getFragInfos().size() );
- assertEquals( "subInfos=(theboth((195,203)))/0.86791086(189,289)", ffl.getFragInfos().get( 0 ).toString() );
+ assertEquals( "subInfos=(theboth((195,203)))/0.86791086(149,249)", ffl.getFragInfos().get( 0 ).toString() );
}
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/ivy-settings.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/ivy-settings.xml?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/ivy-settings.xml (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/ivy-settings.xml Thu Oct 25 13:10:25 2012
@@ -26,6 +26,8 @@
<include url="${ivy.default.settings.dir}/ivysettings-local.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
+ <caches lockStrategy="artifact-lock"/>
+
<resolvers>
<ibiblio name="sonatype-releases" root="http://oss.sonatype.org/content/repositories/releases" m2compatible="true" />
Modified: lucene/dev/branches/LUCENE-2878/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinCollector.java Thu Oct 25 13:10:25 2012
@@ -461,10 +461,12 @@ public class ToParentBlockJoinCollector
totalHitCount);
}
- /** Returns the highest score across all collected parent
- * hits, as long as <code>trackMaxScores=true</code> was passed {@link
- * #ToParentBlockJoinCollector(Sort, int, boolean, boolean) on construction}. Else,
- * this returns <code>Float.NaN</code> */
+ /**
+ * Returns the highest score across all collected parent hits, as long as
+ * <code>trackMaxScores=true</code> was passed
+ * {@link #ToParentBlockJoinCollector(Sort, int, boolean, boolean) on
+ * construction}. Else, this returns <code>Float.NaN</code>
+ */
public float getMaxScore() {
return maxScore;
}
Modified: lucene/dev/branches/LUCENE-2878/lucene/licenses/servlet-api-NOTICE.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/licenses/servlet-api-NOTICE.txt?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/licenses/servlet-api-NOTICE.txt (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/licenses/servlet-api-NOTICE.txt Thu Oct 25 13:10:25 2012
@@ -1,5 +1,2 @@
-Apache Tomcat
-Copyright 1999-2007 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
+Servlet-api.jar is under the CDDL license, the original source
+code for this can be found at http://www.eclipse.org/jetty/downloads.php
Modified: lucene/dev/branches/LUCENE-2878/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java Thu Oct 25 13:10:25 2012
@@ -30,7 +30,7 @@ import org.apache.lucene.analysis.BaseTo
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenFilter;
import org.apache.lucene.analysis.MockTokenizer;
-import org.apache.lucene.codecs.lucene40.Lucene40PostingsFormat;
+import org.apache.lucene.codecs.lucene41.Lucene41PostingsFormat;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.AtomicReader;
@@ -123,7 +123,7 @@ public class MemoryIndexTest extends Bas
Directory ramdir = new RAMDirectory();
Analyzer analyzer = randomAnalyzer();
IndexWriter writer = new IndexWriter(ramdir,
- new IndexWriterConfig(TEST_VERSION_CURRENT, analyzer).setCodec(_TestUtil.alwaysPostingsFormat(new Lucene40PostingsFormat())));
+ new IndexWriterConfig(TEST_VERSION_CURRENT, analyzer).setCodec(_TestUtil.alwaysPostingsFormat(new Lucene41PostingsFormat())));
Document doc = new Document();
Field field1 = newTextField("foo", fooField.toString(), Field.Store.NO);
Field field2 = newTextField("term", termField.toString(), Field.Store.NO);
Modified: lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/index/IndexSplitter.java Thu Oct 25 13:10:25 2012
@@ -55,9 +55,6 @@ public class IndexSplitter {
File dir;
- /**
- * @param args
- */
public static void main(String[] args) throws Exception {
if (args.length < 2) {
System.err
Modified: lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java Thu Oct 25 13:10:25 2012
@@ -55,7 +55,7 @@ public class MultiPassIndexSplitter {
* @param seq if true, then the source index will be split into equal
* increasing ranges of document id-s. If false, source document id-s will be
* assigned in a deterministic round-robin fashion to one of the output splits.
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public void split(Version version, IndexReader in, Directory[] outputs, boolean seq) throws IOException {
if (outputs == null || outputs.length < 2) {
Modified: lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/misc/HighFreqTerms.java Thu Oct 25 13:10:25 2012
@@ -106,12 +106,7 @@ public class HighFreqTerms {
+ "java org.apache.lucene.misc.HighFreqTerms <index dir> [-t] [number_terms] [field]\n\t -t: include totalTermFreq\n\n");
}
/**
- *
- * @param reader
- * @param numTerms
- * @param field
- * @return TermStats[] ordered by terms with highest docFreq first.
- * @throws Exception
+ * Returns TermStats[] ordered by terms with highest docFreq first.
*/
public static TermStats[] getHighFreqTerms(IndexReader reader, int numTerms, String field) throws Exception {
TermStatsQueue tiq = null;
@@ -157,11 +152,9 @@ public class HighFreqTerms {
* containing the term and stores the total in the output array of TermStats.
* Output array is sorted by highest total tf.
*
- * @param reader
* @param terms
* TermStats[]
* @return TermStats[]
- * @throws Exception
*/
public static TermStats[] sortByTotalTermFreq(IndexReader reader, TermStats[] terms) throws Exception {
Modified: lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java Thu Oct 25 13:10:25 2012
@@ -97,7 +97,7 @@ public class NativeUnixDirectory extends
* not use direct IO. See {@link
* #DEFAULT_MIN_BYTES_DIRECT}
* @param delegate fallback Directory for non-merges
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public NativeUnixDirectory(File path, int mergeBufferSize, long minBytesDirect, Directory delegate) throws IOException {
super(path, delegate.getLockFactory());
@@ -113,7 +113,7 @@ public class NativeUnixDirectory extends
*
* @param path the path of the directory
* @param delegate fallback Directory for non-merges
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public NativeUnixDirectory(File path, Directory delegate) throws IOException {
this(path, DEFAULT_MERGE_BUFFER_SIZE, DEFAULT_MIN_BYTES_DIRECT, delegate);
@@ -236,26 +236,6 @@ public class NativeUnixDirectory extends
return filePos + bufferPos;
}
- // TODO: seek is fragile at best; it can only properly
- // handle seek & then change bytes that fit entirely
- // within one buffer
- @Override
- public void seek(long pos) throws IOException {
- if (pos != getFilePointer()) {
- dump();
- final long alignedPos = pos & ALIGN_NOT_MASK;
- filePos = alignedPos;
- int n = (int) NativePosixUtil.pread(fos.getFD(), filePos, buffer);
- if (n < bufferSize) {
- buffer.limit(n);
- }
- //System.out.println("seek refill=" + n);
- final int delta = (int) (pos - alignedPos);
- buffer.position(delta);
- bufferPos = delta;
- }
- }
-
@Override
public long length() {
return fileLength + bufferPos;
Modified: lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/store/WindowsDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/store/WindowsDirectory.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/store/WindowsDirectory.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/misc/src/java/org/apache/lucene/store/WindowsDirectory.java Thu Oct 25 13:10:25 2012
@@ -54,7 +54,7 @@ public class WindowsDirectory extends FS
* @param path the path of the directory
* @param lockFactory the lock factory to use, or null for the default
* ({@link NativeFSLockFactory});
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public WindowsDirectory(File path, LockFactory lockFactory) throws IOException {
super(path, lockFactory);
@@ -63,7 +63,7 @@ public class WindowsDirectory extends FS
/** Create a new WindowsDirectory for the named location and {@link NativeFSLockFactory}.
*
* @param path the path of the directory
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error
*/
public WindowsDirectory(File path) throws IOException {
super(path, null);
Modified: lucene/dev/branches/LUCENE-2878/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java Thu Oct 25 13:10:25 2012
@@ -22,6 +22,7 @@ import org.apache.lucene.analysis.MockAn
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util._TestUtil;
@@ -34,6 +35,11 @@ public class TestIndexSplitter extends L
_TestUtil.rmDir(destDir);
destDir.mkdirs();
Directory fsDir = newFSDirectory(dir);
+ // IndexSplitter.split makes its own commit directly with SIPC/SegmentInfos,
+ // so the unreferenced files are expected.
+ if (fsDir instanceof MockDirectoryWrapper) {
+ ((MockDirectoryWrapper)fsDir).setAssertNoUnrefencedFilesOnClose(false);
+ }
LogMergePolicy mergePolicy = new LogByteSizeMergePolicy();
mergePolicy.setNoCFSRatio(1.0);
Modified: lucene/dev/branches/LUCENE-2878/lucene/module-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/module-build.xml?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/module-build.xml (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/module-build.xml Thu Oct 25 13:10:25 2012
@@ -28,8 +28,6 @@
<import file="common-build.xml"/>
- <available property="module.has.tests" type="dir" file="src/test" />
-
<!-- if you extend the classpath refid in one contrib's build.xml (add JARs), use this as basis: -->
<path id="base.classpath">
<pathelement location="${common.dir}/build/core/classes/java"/>
@@ -40,8 +38,8 @@
<path id="classpath" refid="base.classpath"/>
<path id="test.base.classpath">
- <pathelement location="${common.dir}/build/codecs/classes/java"/>
<pathelement location="${common.dir}/build/test-framework/classes/java"/>
+ <pathelement location="${common.dir}/build/codecs/classes/java"/>
<path refid="classpath"/>
<path refid="junit-path"/>
<pathelement location="${build.dir}/classes/java"/>
Modified: lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/TermsFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/TermsFilter.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/TermsFilter.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/TermsFilter.java Thu Oct 25 13:10:25 2012
@@ -42,8 +42,6 @@ public class TermsFilter extends Filter
/**
* Adds a term to the list of acceptable terms
- *
- * @param term
*/
public void addTerm(Term term) {
terms.add(term);
@@ -81,7 +79,7 @@ public class TermsFilter extends Filter
if (terms != null) { // TODO this check doesn't make sense, decide which variable its supposed to be for
br.copyBytes(term.bytes());
assert termsEnum != null;
- if (termsEnum.seekCeil(br) == TermsEnum.SeekStatus.FOUND) {
+ if (termsEnum.seekExact(br,true)) {
docs = termsEnum.docs(acceptDocs, docs, 0);
while (docs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
result.set(docs.docID());
Modified: lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/NumericIndexDocValueSource.java Thu Oct 25 13:10:25 2012
@@ -30,8 +30,7 @@ import org.apache.lucene.queries.functio
* This {@link ValueSource} is compatible with all numerical
* {@link FunctionValues}
*
- * @lucene.experimental
- *
+ * @deprecated Use {@link NumericDocValuesFieldSource} instead.
*/
public class NumericIndexDocValueSource extends ValueSource {
@@ -63,6 +62,10 @@ public class NumericIndexDocValueSource
}
};
+ case FIXED_INTS_8:
+ case FIXED_INTS_16:
+ case FIXED_INTS_32:
+ case FIXED_INTS_64:
case VAR_INTS:
return new FunctionValues() {
@Override
Modified: lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queries/src/java/org/apache/lucene/queries/mlt/MoreLikeThis.java Thu Oct 25 13:10:25 2012
@@ -292,6 +292,7 @@ public final class MoreLikeThis {
* Returns the boost factor used when boosting terms
*
* @return the boost factor used when boosting terms
+ * @see #setBoostFactor(float)
*/
public float getBoostFactor() {
return boostFactor;
@@ -300,7 +301,7 @@ public final class MoreLikeThis {
/**
* Sets the boost factor to use when boosting terms
*
- * @param boostFactor
+ * @see #getBoostFactor()
*/
public void setBoostFactor(float boostFactor) {
this.boostFactor = boostFactor;
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/AnalyzingQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/AnalyzingQueryParser.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/AnalyzingQueryParser.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/analyzing/AnalyzingQueryParser.java Thu Oct 25 13:10:25 2012
@@ -72,7 +72,6 @@ public class AnalyzingQueryParser extend
* characters (? or *), but is not simple prefix term
*
* @return Resulting {@link Query} built for the term
- * @throws ParseException
*/
@Override
protected Query getWildcardQuery(String field, String termStr) throws ParseException {
@@ -190,7 +189,6 @@ public class AnalyzingQueryParser extend
* (<b>without</b> trailing '*' character!)
*
* @return Resulting {@link Query} built for the term
- * @throws ParseException
*/
@Override
protected Query getPrefixQuery(String field, String termStr) throws ParseException {
@@ -243,7 +241,6 @@ public class AnalyzingQueryParser extend
* @param termStr Term token to use for building term for the query
*
* @return Resulting {@link Query} built for the term
- * @exception ParseException
*/
@Override
protected Query getFuzzyQuery(String field, String termStr, float minSimilarity)
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/classic/QueryParserBase.java Thu Oct 25 13:10:25 2012
@@ -662,10 +662,6 @@ public abstract class QueryParserBase im
return query;
}
- /**
- *
- * @exception org.apache.lucene.queryparser.classic.ParseException
- */
protected Query getRangeQuery(String field,
String part1,
String part2,
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/QueryBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/QueryBuilder.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/QueryBuilder.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/builders/QueryBuilder.java Thu Oct 25 13:10:25 2012
@@ -36,8 +36,6 @@ public interface QueryBuilder {
* the query tree root node
*
* @return some object generated from the query tree
- *
- * @throws QueryNodeException
*/
Object build(QueryNode queryNode) throws QueryNodeException;
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/AbstractQueryConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/AbstractQueryConfig.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/AbstractQueryConfig.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/config/AbstractQueryConfig.java Thu Oct 25 13:10:25 2012
@@ -81,7 +81,7 @@ public abstract class AbstractQueryConfi
*
* @param <T> the value's type
* @param key the key, cannot be <code>null</code>
- * @param value
+ * @param value value to set
*/
public <T> void set(ConfigurationKey<T> key, T value) {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/GroupQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/GroupQueryNode.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/GroupQueryNode.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/GroupQueryNode.java Thu Oct 25 13:10:25 2012
@@ -71,9 +71,6 @@ public class GroupQueryNode extends Quer
return clone;
}
- /**
- * @param child
- */
public void setChild(QueryNode child) {
List<QueryNode> list = new ArrayList<QueryNode>();
list.add(child);
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java Thu Oct 25 13:10:25 2012
@@ -149,9 +149,6 @@ public class ModifierQueryNode extends Q
return clone;
}
- /**
- * @param child
- */
public void setChild(QueryNode child) {
List<QueryNode> list = new ArrayList<QueryNode>();
list.add(child);
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNode.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNode.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNode.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNode.java Thu Oct 25 13:10:25 2012
@@ -46,8 +46,7 @@ public interface QueryNode {
public boolean containsTag(String tagName);
/**
- * @param tagName
- * @return of stored on under that tag name
+ * Returns object stored under that tag name
*/
public Object getTag(String tagName);
@@ -58,7 +57,6 @@ public interface QueryNode {
* when you call the cloneTree() method
*
* @return the cloned tree
- * @throws CloneNotSupportedException
*/
public QueryNode cloneTree() throws CloneNotSupportedException;
@@ -77,16 +75,11 @@ public interface QueryNode {
* Associate the specified value with the specified tagName. If the tagName
* already exists, the old value is replaced. The tagName and value cannot be
* null. tagName will be converted to lowercase.
- *
- * @param tagName
- * @param value
*/
public void setTag(String tagName, Object value);
/**
* Unset a tag. tagName will be converted to lowercase.
- *
- * @param tagName
*/
public void unsetTag(String tagName);
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/QueryNodeProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/QueryNodeProcessor.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/QueryNodeProcessor.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/processors/QueryNodeProcessor.java Thu Oct 25 13:10:25 2012
@@ -55,15 +55,11 @@ public interface QueryNodeProcessor {
* tree root node
*
* @return the processed query tree
- *
- * @throws QueryNodeException
*/
public QueryNode process(QueryNode queryTree) throws QueryNodeException;
/**
* Sets the {@link QueryConfigHandler} associated to the query tree.
- *
- * @param queryConfigHandler
*/
public void setQueryConfigHandler(QueryConfigHandler queryConfigHandler);
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/UnescapedCharSequence.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/UnescapedCharSequence.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/UnescapedCharSequence.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/util/UnescapedCharSequence.java Thu Oct 25 13:10:25 2012
@@ -29,11 +29,6 @@ public final class UnescapedCharSequence
/**
* Create a escaped CharSequence
- *
- * @param chars
- * @param wasEscaped
- * @param offset
- * @param length
*/
public UnescapedCharSequence(char[] chars, boolean[] wasEscaped, int offset,
int length) {
@@ -45,8 +40,6 @@ public final class UnescapedCharSequence
/**
* Create a non-escaped CharSequence
- *
- * @param text
*/
public UnescapedCharSequence(CharSequence text) {
this.chars = new char[text.length()];
@@ -59,8 +52,6 @@ public final class UnescapedCharSequence
/**
* Create a copy of an existent UnescapedCharSequence
- *
- * @param text
*/
@SuppressWarnings("unused")
private UnescapedCharSequence(UnescapedCharSequence text) {
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/NLS.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/NLS.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/NLS.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/messages/NLS.java Thu Oct 25 13:10:25 2012
@@ -122,9 +122,6 @@ public class NLS {
return null;
}
- /**
- * @param clazz
- */
private static void load(Class<? extends NLS> clazz) {
final Field[] fieldArray = clazz.getDeclaredFields();
@@ -139,10 +136,6 @@ public class NLS {
}
}
- /**
- * @param field
- * @param isFieldAccessible
- */
private static void loadfieldValue(Field field, boolean isFieldAccessible,
Class<? extends NLS> clazz) {
int MOD_EXPECTED = Modifier.PUBLIC | Modifier.STATIC;
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/StandardBooleanQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/StandardBooleanQueryNode.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/StandardBooleanQueryNode.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/StandardBooleanQueryNode.java Thu Oct 25 13:10:25 2012
@@ -36,9 +36,6 @@ public class StandardBooleanQueryNode ex
private boolean disableCoord;
- /**
- * @param clauses
- */
public StandardBooleanQueryNode(List<QueryNode> clauses, boolean disableCoord) {
super(clauses);
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/RewriteQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/RewriteQuery.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/RewriteQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/surround/query/RewriteQuery.java Thu Oct 25 13:10:25 2012
@@ -72,7 +72,9 @@ abstract class RewriteQuery<SQ extends S
&& srndQuery.equals(other.srndQuery);
}
- /** @throws UnsupportedOperationException */
+ /**
+ * Not supported by this query.
+ * @throws UnsupportedOperationException always: clone is not supported. */
@Override
public RewriteQuery clone() {
throw new UnsupportedOperationException();
Modified: lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CoreParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CoreParser.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CoreParser.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/queryparser/src/java/org/apache/lucene/queryparser/xml/CoreParser.java Thu Oct 25 13:10:25 2012
@@ -45,7 +45,6 @@ public class CoreParser implements Query
* Construct an XML parser that uses a single instance QueryParser for handling
* UserQuery tags - all parse operations are synchronised on this parser
*
- * @param analyzer
* @param parser A QueryParser which will be synchronized on during parse calls.
*/
public CoreParser(Analyzer analyzer, QueryParser parser) {
@@ -56,7 +55,6 @@ public class CoreParser implements Query
* Constructs an XML parser that creates a QueryParser for each UserQuery request.
*
* @param defaultField The default field name used by QueryParsers constructed for UserQuery tags
- * @param analyzer
*/
public CoreParser(String defaultField, Analyzer analyzer) {
this(defaultField, analyzer, null);
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=1402140&r1=1402139&r2=1402140&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 Thu Oct 25 13:10:25 2012
@@ -32,7 +32,6 @@ public class CorePlusExtensionsParser ex
* Construct an XML parser that uses a single instance QueryParser for handling
* UserQuery tags - all parse operations are synchronized on this parser
*
- * @param analyzer
* @param parser A QueryParser which will be synchronized on during parse calls.
*/
public CorePlusExtensionsParser(Analyzer analyzer, QueryParser parser) {
@@ -43,7 +42,6 @@ public class CorePlusExtensionsParser ex
* Constructs an XML parser that creates a QueryParser for each UserQuery request.
*
* @param defaultField The default field name used by QueryParsers constructed for UserQuery tags
- * @param analyzer
*/
public CorePlusExtensionsParser(String defaultField, Analyzer analyzer) {
this(defaultField, analyzer, null);
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=1402140&r1=1402139&r2=1402140&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 Thu Oct 25 13:10:25 2012
@@ -89,8 +89,6 @@ public class DOMUtils {
/**
* Returns an attribute value from this node, or first parent node with this attribute defined
*
- * @param element
- * @param attributeName
* @return A non-zero-length value if defined, otherwise null
*/
public static String getAttributeWithInheritance(Element element, String attributeName) {
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=1402140&r1=1402139&r2=1402140&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 Thu Oct 25 13:10:25 2012
@@ -25,31 +25,18 @@ package org.apache.lucene.queryparser.xm
*/
public class ParserException extends Exception {
- /**
- *
- */
public ParserException() {
super();
}
- /**
- * @param message
- */
public ParserException(String message) {
super(message);
}
- /**
- * @param message
- * @param cause
- */
public ParserException(String message, Throwable cause) {
super(message, cause);
}
- /**
- * @param cause
- */
public ParserException(Throwable cause) {
super(cause);
}
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=1402140&r1=1402139&r2=1402140&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 Thu Oct 25 13:10:25 2012
@@ -107,8 +107,6 @@ public class NumericRangeFilterBuilder i
* any documents.
* <p/>
* Defaults to false.
- *
- * @param strictMode
*/
public void setStrictMode(boolean strictMode) {
this.strictMode = strictMode;
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=1402140&r1=1402139&r2=1402140&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 Thu Oct 25 13:10:25 2012
@@ -29,9 +29,6 @@ public class SpanNotBuilder extends Span
private final SpanQueryBuilder factory;
- /**
- * @param factory
- */
public SpanNotBuilder(SpanQueryBuilder factory) {
this.factory = factory;
}
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=1402140&r1=1402139&r2=1402140&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 Thu Oct 25 13:10:25 2012
@@ -40,9 +40,6 @@ public class SpanOrTermsBuilder extends
private final Analyzer analyzer;
- /**
- * @param analyzer
- */
public SpanOrTermsBuilder(Analyzer analyzer) {
this.analyzer = analyzer;
}
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=1402140&r1=1402139&r2=1402140&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 Thu Oct 25 13:10:25 2012
@@ -39,9 +39,6 @@ public class TermsFilterBuilder implemen
private final Analyzer analyzer;
- /**
- * @param analyzer
- */
public TermsFilterBuilder(Analyzer analyzer) {
this.analyzer = analyzer;
}
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=1402140&r1=1402139&r2=1402140&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 Thu Oct 25 13:10:25 2012
@@ -82,8 +82,6 @@ public class UserInputQueryBuilder imple
/**
* Method to create a QueryParser - designed to be overridden
*
- * @param fieldName
- * @param analyzer
* @return QueryParser
*/
protected QueryParser createQueryParser(String fieldName, Analyzer analyzer) {
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=1402140&r1=1402139&r2=1402140&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 Thu Oct 25 13:10:25 2012
@@ -110,7 +110,6 @@ public class FuzzyLikeThisQuery extends
/**
*
* @param maxNumTerms The total number of terms clauses that will appear once rewritten as a BooleanQuery
- * @param analyzer
*/
public FuzzyLikeThisQuery(int maxNumTerms, Analyzer analyzer)
{
@@ -180,7 +179,6 @@ public class FuzzyLikeThisQuery extends
/**
* Adds user input for "fuzzification"
* @param queryString The string which will be parsed by the analyzer and for which fuzzy variants will be parsed
- * @param fieldName
* @param minSimilarity The minimum similarity of the term variants (see FuzzyTermsEnum)
* @param prefixLength Length of required common prefix on variant terms (see FuzzyTermsEnum)
*/
Modified: lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeQuery.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeQuery.java Thu Oct 25 13:10:25 2012
@@ -110,7 +110,7 @@ public class SlowCollatedTermRangeQuery
lowerTerm, upperTerm, includeLower, includeUpper, collator);
}
- /** @deprecated */
+ /** @deprecated Use {@link #getField()} instead. */
@Deprecated
public String field() {
return getField();
Modified: lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowCollatedTermRangeTermsEnum.java Thu Oct 25 13:10:25 2012
@@ -50,7 +50,7 @@ public class SlowCollatedTermRangeTermsE
* (you can't select all but the first or last term without
* explicitly specifying the term to exclude.)
*
- * @param tenum
+ * @param tenum source of the terms to enumerate.
* @param lowerTermText
* The term text at the lower end of the range
* @param upperTermText
Modified: lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyTermsEnum.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyTermsEnum.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/SlowFuzzyTermsEnum.java Thu Oct 25 13:10:25 2012
@@ -83,7 +83,7 @@ public final class SlowFuzzyTermsEnum ex
* After calling the constructor the enumeration is already pointing to the first
* valid term if such a term exists.
*
- * @throws IOException
+ * @throws IOException If there is a low-level I/O error.
*/
public LinearFuzzyTermsEnum() throws IOException {
super(terms.iterator(null));
Modified: lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexQuery.java?rev=1402140&r1=1402139&r2=1402140&view=diff
==============================================================================
--- lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexQuery.java (original)
+++ lucene/dev/branches/LUCENE-2878/lucene/sandbox/src/java/org/apache/lucene/sandbox/queries/regex/RegexQuery.java Thu Oct 25 13:10:25 2012
@@ -51,18 +51,10 @@ public class RegexQuery extends MultiTer
return term;
}
- /**
- * Defines which {@link RegexCapabilities} implementation is used by this instance.
- *
- * @param impl
- */
public void setRegexImplementation(RegexCapabilities impl) {
this.regexImpl = impl;
}
- /**
- * @return The implementation used by this instance.
- */
public RegexCapabilities getRegexImplementation() {
return regexImpl;
}