LUCENE-6732: Improve checker for invalid source patterns to also detect javadoc-style license headers. Use Groovy to implement the checks instead of plain Ant

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1695380 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2015-08-11 22:13:00 +00:00
parent 11ac3f7f88
commit f0654e355e
127 changed files with 565 additions and 538 deletions

View File

@ -124,32 +124,75 @@
</subant>
</target>
<target name="-validate-source-patterns" unless="disable.source-patterns">
<!-- check that there are no @author javadoc tags, tabs, svn keywords or nocommits: -->
<property name="validate.currDir" location="."/>
<pathconvert pathsep="${line.separator}" dirsep="/" property="validate.patternsFound" setonempty="false">
<fileset dir="${validate.currDir}">
<include name="**/*.java"/>
<include name="**/*.py"/>
<or>
<containsregexp expression="@author\b" casesensitive="yes"/>
<containsregexp expression="\bno(n|)commit\b" casesensitive="no"/>
<containsregexp expression="\bTOOD:" casesensitive="yes"/>
<containsregexp expression="\t" casesensitive="no"/>
<containsregexp expression="\$(?:LastChanged)?Date\b" casesensitive="yes"/>
<containsregexp expression="\$(?:(?:LastChanged)?Revision|Rev)\b" casesensitive="yes"/>
<containsregexp expression="\$(?:LastChangedBy|Author)\b" casesensitive="yes"/>
<containsregexp expression="\$(?:Head)?URL\b" casesensitive="yes"/>
<containsregexp expression="\$Id\b" casesensitive="yes"/>
<containsregexp expression="\$Header\b" casesensitive="yes"/>
<containsregexp expression="\$Source\b" casesensitive="yes"/>
</or>
</fileset>
<map from="${validate.currDir}${file.separator}" to="* "/>
</pathconvert>
<fail if="validate.patternsFound">The following files contain @author tags, tabs, TOODs, svn keywords or nocommits:${line.separator}${validate.patternsFound}</fail>
<target name="-validate-source-patterns" unless="disable.source-patterns" depends="resolve-groovy">
<!-- check that there are no @author javadoc tags, tabs, svn keywords, javadoc-style licenses, or nocommits: -->
<property name="validate.baseDir" location="."/>
<groovy taskname="source-patterns"><![CDATA[
import org.apache.tools.ant.BuildException;
def extensions = [
'java', 'jflex', 'py', 'pl', 'g4', 'jj', 'html'
// TODO: js, xml
];
def invalidPatterns = [
(~$/@author\b/$) : '@author javadoc tag',
(~$/(?i)\bno(n|)commit\b/$) : 'nocommit',
(~$/\bTOOD:/$) : 'TOOD instead TODO',
(~$/\t/$) : 'tabs instead spaces',
(~$/\$$(?:LastChanged)?Date\b/$) : 'svn keyword',
(~$/\$$(?:(?:LastChanged)?Revision|Rev)\b/$) : 'svn keyword',
(~$/\$$(?:LastChangedBy|Author)\b/$) : 'svn keyword',
(~$/\$$(?:Head)?URL\b/$) : 'svn keyword',
(~$/\$$Id\b/$) : 'svn keyword',
(~$/\$$Header\b/$) : 'svn keyword',
(~$/\$$Source\b/$) : 'svn keyword',
];
def licenseOuterPattern = ~$/(?sm)^\Q/**\E(.*?)\Q*/\E/$;
def licenseInnerPattern = ~$/\bLicensed\s+(to|under)\b/$;
def baseDir = properties['validate.baseDir'];
def baseDirLen = baseDir.length() + 1;
def found = 0;
def violations = new TreeSet();
def reportViolation = { f, name ->
task.log(name + ': ' + f.toString().substring(baseDirLen).replace(File.separatorChar, (char)'/'));
violations.add(name);
found++;
}
ant.fileScanner{
fileset(dir: baseDir){
extensions.each{
include(name: 'lucene/**/*.' + it)
include(name: 'solr/**/*.' + it)
include(name: 'dev-tools/**/*.' + it)
include(name: '*.' + it)
}
exclude(name: '**/build/**')
}
}.each{ f ->
def text = f.getText('UTF-8');
invalidPatterns.each{ pattern,name ->
if (pattern.matcher(text).find()) {
reportViolation(f, name);
}
}
def m = licenseOuterPattern.matcher(text);
while (m.find()) {
if (licenseInnerPattern.matcher(m.group(1)).find()) {
reportViolation(f, 'javadoc-style license header');
}
}
};
if (found) {
throw new BuildException(String.format(Locale.ENGLISH, 'Found %d violations in source files (%s).',
found, violations.join(', ')));
}
]]></groovy>
</target>
<target name="rat-sources" description="Runs rat across all sources and tests" depends="common.rat-sources">
<subant target="rat-sources" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" />

View File

@ -69,6 +69,12 @@ Other
* LUCENE-6729: Upgrade ASM used in expressions module to version 5.0.4.
(Uwe Schindler)
Build
* LUCENE-6732: Improve checker for invalid source patterns to also
detect javadoc-style license headers. Use Groovy to implement the
checks instead of plain Ant. (Uwe Schindler)
======================= Lucene 5.3.0 =======================
New Features

View File

@ -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.

View File

@ -516,7 +516,7 @@ You can download this version of this file from http://www.w3.org/TR/2010/REC-xh
return text
def get_apache_license():
license = r"""/**
license = r"""/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.el;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.el;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.sinks;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.th;
/**
/*
* Copyright 2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -2,7 +2,7 @@
package org.apache.lucene.analysis.wikipedia;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.wikipedia;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.collation;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.core;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.el;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.miscellaneous;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.miscellaneous;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.payloads;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.payloads;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.payloads;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.sinks;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.sinks;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.sinks;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.snowball;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.standard;
/**
/*
* 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.

View File

@ -42,7 +42,7 @@ my $output_filename = "${class_name}.java";
my $header =<<"__HEADER__";
package org.apache.lucene.analysis.core;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.collation;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.collation;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.collation;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.ja;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.ja;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.ja;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.ja;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.analysis.ja;
/**
/*
* 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.

View File

@ -1,4 +1,4 @@
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may

View File

@ -1,4 +1,4 @@
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not

View File

@ -1,5 +1,5 @@
package org.apache.lucene.benchmark;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,5 +1,5 @@
package org.apache.lucene.benchmark.byTask.feeds;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,3 +1,19 @@
/*
* Copyright 2004 The Apache Software Foundation
* <p/>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.lucene.benchmark.byTask.feeds;
import org.apache.lucene.analysis.Analyzer;
@ -15,22 +31,6 @@ import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
/**
* Copyright 2004 The Apache Software Foundation
* <p/>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Create queries from a FileReader. One per line, pass them through the
* QueryParser. Lines beginning with # are treated as comments

View File

@ -1,6 +1,6 @@
package org.apache.lucene.benchmark.byTask.programmatic;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,5 +1,5 @@
package org.apache.lucene.benchmark.byTask.tasks;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,5 +1,5 @@
package org.apache.lucene.benchmark.byTask.tasks;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,5 +1,5 @@
package org.apache.lucene.benchmark.utils;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,5 +1,5 @@
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.

View File

@ -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.

View File

@ -1,5 +1,5 @@
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.

View File

@ -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.

View File

@ -1,5 +1,5 @@
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.

View File

@ -1,5 +1,5 @@
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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.codecs.memory;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.codecs;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not

View File

@ -1,6 +1,6 @@
package org.apache.lucene.codecs;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not

View File

@ -1,6 +1,6 @@
package org.apache.lucene.search;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,5 +1,5 @@
package org.apache.lucene.search.spans;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.util;
/**
/*
* 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. The ASF

View File

@ -1,5 +1,5 @@
package org.apache.lucene.util;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.index;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.index;
/**
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
package org.apache.lucene.index;
/**
/*
* Copyright 2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.index;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.index;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.index;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.index;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.index;
/**
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at

View File

@ -1,6 +1,6 @@
package org.apache.lucene.index;
/**
/*
* Copyright 2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.search;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.search.payloads;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.util;
/**
/*
* 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.

View File

@ -1,21 +1,21 @@
package org.apache.lucene.util;
/**
* 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.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* 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.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.Arrays;
import java.util.Collections;

View File

@ -1,6 +1,6 @@
package org.apache.lucene.util;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,5 +1,5 @@
package org.apache.lucene.search.highlight;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,5 +1,5 @@
package org.apache.lucene.search.highlight;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,5 +1,5 @@
package org.apache.lucene.search.highlight;
/**
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.search.vectorhighlight;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.search.vectorhighlight;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.search.vectorhighlight;
/**
/*
* 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.

View File

@ -1,6 +1,6 @@
package org.apache.lucene.document;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,20 +1,20 @@
package org.apache.lucene.misc;
/**
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;

View File

@ -1,5 +1,5 @@
package org.apache.lucene.uninverting;
/**
/*
* Copyright 2009 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.uninverting;
/**
/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.uninverting;
/**
/*
* Copyright 2009 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,6 +1,6 @@
package org.apache.lucene.queries.mlt;
/**
/*
* Copyright 2004-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -27,20 +27,20 @@ Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a
</td></tr></table>
<p>BooleanQuerys implement Boolean logic which controls how multiple Clauses should be interpreted.
Some clauses may represent optional Query criteria while others represent mandatory criteria.</p><p><span class='inTextTitle'>Example:</span> <em>Find articles about banks, preferably talking about mergers but nothing to do with "sumitomo"</em>
</p><pre>
</p><pre>
&lt;BooleanQuery fieldName="contents"&gt;
&lt;Clause occurs="should"&gt;
&lt;TermQuery&gt;merger&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="mustnot"&gt;
&lt;TermQuery&gt;sumitomo&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="must"&gt;
&lt;TermQuery&gt;bank&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="should"&gt;
&lt;TermQuery&gt;merger&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="mustnot"&gt;
&lt;TermQuery&gt;sumitomo&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="must"&gt;
&lt;TermQuery&gt;bank&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;/BooleanQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;BooleanQuery&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;BooleanQuery&gt;'s children</th></tr>
@ -138,18 +138,18 @@ Bitsets at a cost of 1 bit per document in the index. The memory cost of a cache
Queries that are cached as filters obviously retain none of the scoring information associated with results - they retain just
a Boolean yes/no record of which documents matched.</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about banks from the last 10 years - caching the commonly-used "last 10 year" filter as a BitSet in
RAM to eliminate the cost of building this filter from disk for every query</em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;UserQuery&gt;bank&lt;/UserQuery&gt;
&lt;/Query&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;CachedFilter&gt;
&lt;RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/&gt;
&lt;/CachedFilter&gt;
&lt;/Filter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;CachedFilter&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;CachedFilter&gt;'s children</th></tr>
@ -188,9 +188,9 @@ RAM to eliminate the cost of building this filter from disk for every query</em>
Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a>
</td></tr></table>
<p>Passes content directly through to the standard LuceneQuery parser see "Lucene Query Syntax"</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about John Smith or John Doe using standard LuceneQuerySyntax</em>
</p><pre>
</p><pre>
&lt;UserQuery&gt;"John Smith" OR "John Doe"&lt;/UserQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;UserQuery&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;UserQuery&gt;'s attributes</th>
</tr>
@ -221,24 +221,24 @@ is a "mustNot" match (Lucene requires at least one positive clause) and..</li>
<li> in a FilteredQuery where a Filter tag is effectively being
used to select content rather than its usual role of filtering the results of a query.</li>
</ol></p><p><span class='inTextTitle'>Example:</span> <em>Effectively use a Filter as a query </em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;MatchAllDocsQuery/&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;RangeFilter fieldName="date" lowerTerm="19870409" upperTerm="19870412"/&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><p class='emptyTagNote'>This element is always empty.</p><a name='TermQuery'></a>
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><p class='emptyTagNote'>This element is always empty.</p><a name='TermQuery'></a>
<br /><table class='elementTitle' summary="TermQuery"><tr><td class='leftElementTitle'>
&lt;TermQuery&gt;</td><td class='rightElementTitle'>
Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a>
</td></tr></table>
<p>a single term query - no analysis is done of the child text</p><p><span class='inTextTitle'>Example:</span> <em>Match on a primary key</em>
</p><pre>
</p><pre>
&lt;TermQuery fieldName="primaryKey"&gt;13424&lt;/TermQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;TermQuery&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;TermQuery&gt;'s attributes</th>
</tr>
@ -282,9 +282,9 @@ Child text is analyzed using a field-specific choice of Analyzer to produce a se
Unlike UserQuery element, this does not parse any special characters to control fuzzy/phrase/boolean logic and as such is incapable
of producing a Query parse error given any user input</p><p><span class='inTextTitle'>Example:</span> <em>Match on text from a database description (which may contain characters that
are illegal characters in the standard Lucene Query syntax used in the UserQuery tag</em>
</p><pre>
</p><pre>
&lt;TermsQuery fieldName="description"&gt;Smith & Sons (Ltd) : incorporated 1982&lt;/TermsQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;TermsQuery&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;TermsQuery&gt;'s attributes</th>
</tr>
@ -319,16 +319,16 @@ Attribute of <a href='#TermsQuery'>TermsQuery</a>
Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a>
</td></tr></table>
<p>Runs a Query and filters results to only those query matches that also match the Filter element.</p><p><span class='inTextTitle'>Example:</span> <em>Find all documents about Lucene that have a status of "published"</em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;UserQuery&gt;Lucene&lt;/UserQuery&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;TermsFilter fieldName="status"&gt;published&lt;/TermsFilter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;FilteredQuery&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;FilteredQuery&gt;'s children</th></tr>
@ -409,16 +409,16 @@ Child of <a href='#FilteredQuery'>FilteredQuery</a>
Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a>
</td></tr></table>
<p>Filter used to limit query results to documents matching a range of field values</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about banks from the last 10 years</em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;UserQuery&gt;bank&lt;/UserQuery&gt;
&lt;/Query&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/&gt;
&lt;/Filter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote>
</pre><p></p><blockquote>
<table summary="&lt;RangeFilter&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;RangeFilter&gt;'s attributes</th>
</tr>
@ -458,9 +458,9 @@ Attribute of <a href='#RangeFilter'>RangeFilter</a>
Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#Query'>Query</a>
</td></tr></table>
<p>A Query that matches numeric values within a specified range.</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about people who are aged 20-25</em>
</p><pre>
</p><pre>
&lt;NumericRangeQuery fieldName="age" lowerTerm="20" upperTerm="25" /&gt;
</pre><p></p><blockquote>
</pre><p></p><blockquote>
<table summary="&lt;NumericRangeQuery&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;NumericRangeQuery&gt;'s attributes</th>
</tr>
@ -510,16 +510,16 @@ Attribute of <a href='#NumericRangeQuery'>NumericRangeQuery</a>
Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a>
</td></tr></table>
<p>A Filter that only accepts numeric values within a specified range</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about people who are aged 20-25</em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;UserQuery&gt;person&lt;/UserQuery&gt;
&lt;/Query&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;NumericRangeFilter fieldName="age" lowerTerm="20" upperTerm="25"/&gt;
&lt;/Filter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote>
</pre><p></p><blockquote>
<table summary="&lt;NumericRangeFilter&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;NumericRangeFilter&gt;'s attributes</th>
</tr>
@ -570,19 +570,19 @@ Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a
</td></tr></table>
<p>A single term used in a SpanQuery. These clauses are the building blocks for more complex "span" queries which test word proximity</p><p><span class='inTextTitle'>Example:</span> <em>Find documents using terms close to each other about mining and accidents</em>
</p><pre>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanTerm&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;SpanTerm&gt;'s attributes</th>
</tr>
@ -604,11 +604,11 @@ Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a
<p>A field-specific analyzer is used here to parse the child text provided in this tag. The SpanTerms produced are ORed in terms of Boolean logic</p><p><span class='inTextTitle'>Example:</span> <em>Use SpanOrTerms as a more convenient/succinct way of expressing multiple choices of SpanTerms. This example looks for reports
using words describing a fatality near to references to miners</em>
</p><pre>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOrTerms&gt;killed died death dead deaths&lt;/SpanOrTerms&gt;
&lt;SpanOrTerms&gt;miner mining miners&lt;/SpanOrTerms&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOrTerms&gt;killed died death dead deaths&lt;/SpanOrTerms&gt;
&lt;SpanOrTerms&gt;miner mining miners&lt;/SpanOrTerms&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanOrTerms&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;SpanOrTerms&gt;'s attributes</th>
</tr>
@ -629,19 +629,19 @@ Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a
</td></tr></table>
<p>Takes any number of child queries from the Span family</p><p><span class='inTextTitle'>Example:</span> <em>Find documents using terms close to each other about mining and accidents</em>
</p><pre>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanOr&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;SpanOr&gt;'s children</th></tr>
@ -692,19 +692,19 @@ Attribute of <a href='#SpanNear'>SpanNear</a>
</td></tr></table>
<p>defines the maximum distance between Span elements where distance is expressed as word number, not byte offset</p><p><span class='inTextTitle'>Example:</span> <em>Find documents using terms within 8 words of each other talking about mining and accidents</em>
</p><pre>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><p><span class='inTextTitle'>Required</span></p><a name='SpanNear_inOrder'></a>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><p><span class='inTextTitle'>Required</span></p><a name='SpanNear_inOrder'></a>
<br /><table class='attributeTitle' summary="inOrder"><tr><td class='leftAttributeTitle'>
@inOrder</td><td class='rightAttributeTitle'>
Attribute of <a href='#SpanNear'>SpanNear</a>
@ -715,11 +715,11 @@ Attribute of <a href='#SpanNear'>SpanNear</a>
Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a href='#Include'>Include</a>, <a href='#CachedFilter'>CachedFilter</a>, <a href='#SpanOr'>SpanOr</a>, <a href='#SpanNear'>SpanNear</a>, <a href='#Exclude'>Exclude</a>, <a href='#Query'>Query</a>
</td></tr></table>
<p>Looks for a SpanQuery match occuring near the beginning of a document</p><p><span class='inTextTitle'>Example:</span> <em>Find letters where the first 50 words talk about a resignation:</em>
</p><pre>
&lt;SpanFirst end="50"&gt;
&lt;SpanOrTerms fieldName="text"&gt;resigning resign leave&lt;/SpanOrTerms&gt;
&lt;/SpanFirst&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</p><pre>
&lt;SpanFirst end="50"&gt;
&lt;SpanOrTerms fieldName="text"&gt;resigning resign leave&lt;/SpanOrTerms&gt;
&lt;/SpanFirst&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanFirst&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;SpanFirst&gt;'s children</th></tr>
@ -761,16 +761,16 @@ Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a
</p><pre>
&lt;SpanNot fieldName="text"&gt;
&lt;Include&gt;
&lt;SpanNear slop="2" inOrder="true"&gt;
&lt;SpanNear slop="2" inOrder="true"&gt;
&lt;SpanTerm&gt;social&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;services&lt;/SpanTerm&gt;
&lt;/SpanNear&gt;
&lt;/SpanNear&gt;
&lt;/Include&gt;
&lt;Exclude&gt;
&lt;SpanTerm&gt;public&lt;/SpanTerm&gt;
&lt;/Exclude&gt;
&lt;/SpanNot&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanNot&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;SpanNot&gt;'s children</th></tr>
@ -832,8 +832,8 @@ Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a
</p><pre>
&lt;ConstantScoreQuery&gt;
&lt;RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/&gt;
&lt;/ConstantScoreQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;/ConstantScoreQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;ConstantScoreQuery&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;ConstantScoreQuery&gt;'s children</th></tr>
@ -869,13 +869,13 @@ Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a
Improves on FuzzyQuery by rewarding all fuzzy variants of a term with the same IDF rather than default fuzzy behaviour which ranks rarer
variants (typically misspellings) more highly. This can be a useful default search mode for processing user input where the end user
is not expected to know about the standard query operators for fuzzy, boolean or phrase logic found in UserQuery</p><p><span class='inTextTitle'>Example:</span> <em>Search for information about the Sumitomo bank, where the end user has mis-spelt the name</em>
</p><pre>
</p><pre>
&lt;FuzzyLikeThisQuery&gt;
&lt;Field fieldName="contents"&gt;
Sumitimo bank
&lt;/Field&gt;
Sumitimo bank
&lt;/Field&gt;
&lt;/FuzzyLikeThisQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;FuzzyLikeThisQuery&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;FuzzyLikeThisQuery&gt;'s children</th></tr>
@ -965,8 +965,8 @@ appears commonly in the index.</em>
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. Reuters 3;
&lt;/LikeThisQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;/LikeThisQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;LikeThisQuery&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;LikeThisQuery&gt;'s attributes</th>
</tr>
@ -1015,7 +1015,7 @@ Child of <a href='#BoostQuery'>BoostQuery</a>, <a href='#Clause'>Clause</a>, <a
Unlike a regular BooleanQuery the boost can be less than 1 to produce a subtractive rather than additive result
on the match score.</p><p><span class='inTextTitle'>Example:</span> <em>Find documents about banks, preferably related to mergers, and preferably not about "World bank"</em>
</p><pre>
&lt;BoostingQuery&gt;
&lt;BoostingQuery&gt;
&lt;Query&gt;
&lt;BooleanQuery fieldName="contents"&gt;
&lt;Clause occurs="should"&gt;
@ -1024,13 +1024,13 @@ on the match score.</p><p><span class='inTextTitle'>Example:</span> <em>Find doc
&lt;Clause occurs="must"&gt;
&lt;TermQuery&gt;bank&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;/BooleanQuery&gt;
&lt;/BooleanQuery&gt;
&lt;/Query&gt;
&lt;BoostQuery boost="0.01"&gt;
&lt;UserQuery&gt;"world bank"&lt;/UserQuery&gt;
&lt;/BoostQuery&gt;
&lt;/BoostingQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;BoostingQuery&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;BoostingQuery&gt;'s children</th></tr>
@ -1109,11 +1109,11 @@ Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#C
&lt;Query&gt;
&lt;TermQuery fieldName="text"&gt;lucene&lt;/TermQuery&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;DuplicateFilter fieldName="url" keepMode="last"/&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote>
&lt;Filter&gt;
&lt;DuplicateFilter fieldName="url" keepMode="last"/&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote>
<table summary="&lt;DuplicateFilter&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;DuplicateFilter&gt;'s attributes</th>
</tr>
@ -1151,11 +1151,11 @@ Child of <a href='#Clause'>Clause</a>, <a href='#Filter'>Filter</a>, <a href='#C
&lt;Query&gt;
&lt;TermQuery fieldName="text"&gt;lucene&lt;/TermQuery&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;TermsFilter fieldName="dayOfWeek"&gt;monday friday&lt;/TermsFilter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;Filter&gt;
&lt;TermsFilter fieldName="dayOfWeek"&gt;monday friday&lt;/TermsFilter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;TermsFilter&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;TermsFilter&gt;'s attributes</th>
</tr>
@ -1195,7 +1195,7 @@ Unlike BooleanQuery a BooleanFilter can contain a single "mustNot" clause.</p><p
&lt;/BooleanFilter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;BooleanFilter&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;BooleanFilter&gt;'s children</th></tr>

View File

@ -45,20 +45,20 @@ Child of <a href='#Clause'>Clause</a>, <a href='#Query'>Query</a>, <a href='#Cac
</td></tr></table>
<p>BooleanQuerys implement Boolean logic which controls how multiple Clauses should be interpreted.
Some clauses may represent optional Query criteria while others represent mandatory criteria.</p><p><span class='inTextTitle'>Example:</span> <em>Find articles about banks, preferably talking about mergers but nothing to do with "sumitomo"</em>
</p><pre>
</p><pre>
&lt;BooleanQuery fieldName="contents"&gt;
&lt;Clause occurs="should"&gt;
&lt;TermQuery&gt;merger&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="mustnot"&gt;
&lt;TermQuery&gt;sumitomo&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="must"&gt;
&lt;TermQuery&gt;bank&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="should"&gt;
&lt;TermQuery&gt;merger&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="mustnot"&gt;
&lt;TermQuery&gt;sumitomo&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;Clause occurs="must"&gt;
&lt;TermQuery&gt;bank&lt;/TermQuery&gt;
&lt;/Clause&gt;
&lt;/BooleanQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;BooleanQuery&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;BooleanQuery&gt;'s children</th></tr>
@ -150,18 +150,18 @@ Bitsets at a cost of 1 bit per document in the index. The memory cost of a cache
Queries that are cached as filters obviously retain none of the scoring information associated with results - they retain just
a Boolean yes/no record of which documents matched.</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about banks from the last 10 years - caching the commonly-used "last 10 year" filter as a BitSet in
RAM to eliminate the cost of building this filter from disk for every query</em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;UserQuery&gt;bank&lt;/UserQuery&gt;
&lt;/Query&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;CachedFilter&gt;
&lt;RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/&gt;
&lt;/CachedFilter&gt;
&lt;/Filter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;CachedFilter&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;CachedFilter&gt;'s children</th></tr>
@ -194,9 +194,9 @@ RAM to eliminate the cost of building this filter from disk for every query</em>
Child of <a href='#Clause'>Clause</a>, <a href='#Query'>Query</a>, <a href='#CachedFilter'>CachedFilter</a>
</td></tr></table>
<p>Passes content directly through to the standard LuceneQuery parser see "Lucene Query Syntax"</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about John Smith or John Doe using standard LuceneQuerySyntax</em>
</p><pre>
</p><pre>
&lt;UserQuery&gt;"John Smith" OR "John Doe"&lt;/UserQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;UserQuery&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;UserQuery&gt;'s attributes</th>
</tr>
@ -227,24 +227,24 @@ is a "mustNot" match (Lucene requires at least one positive clause) and..</li>
<li> in a FilteredQuery where a Filter tag is effectively being
used to select content rather than its usual role of filtering the results of a query.</li>
</ol></p><p><span class='inTextTitle'>Example:</span> <em>Effectively use a Filter as a query </em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;MatchAllDocsQuery/&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;RangeFilter fieldName="date" lowerTerm="19870409" upperTerm="19870412"/&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><p class='emptyTagNote'>This element is always empty.</p><a name='TermQuery'></a>
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><p class='emptyTagNote'>This element is always empty.</p><a name='TermQuery'></a>
<br /><table class='elementTitle' summary="TermQuery"><tr><td class='leftElementTitle'>
&lt;TermQuery&gt;</td><td class='rightElementTitle'>
Child of <a href='#Clause'>Clause</a>, <a href='#Query'>Query</a>, <a href='#CachedFilter'>CachedFilter</a>
</td></tr></table>
<p>a single term query - no analysis is done of the child text</p><p><span class='inTextTitle'>Example:</span> <em>Match on a primary key</em>
</p><pre>
</p><pre>
&lt;TermQuery fieldName="primaryKey"&gt;13424&lt;/TermQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;TermQuery&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;TermQuery&gt;'s attributes</th>
</tr>
@ -288,9 +288,9 @@ Child text is analyzed using a field-specific choice of Analyzer to produce a se
Unlike UserQuery element, this does not parse any special characters to control fuzzy/phrase/boolean logic and as such is incapable
of producing a Query parse error given any user input</p><p><span class='inTextTitle'>Example:</span> <em>Match on text from a database description (which may contain characters that
are illegal characters in the standard Lucene Query syntax used in the UserQuery tag</em>
</p><pre>
</p><pre>
&lt;TermsQuery fieldName="description"&gt;Smith & Sons (Ltd) : incorporated 1982&lt;/TermsQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;TermsQuery&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;TermsQuery&gt;'s attributes</th>
</tr>
@ -325,16 +325,16 @@ Attribute of <a href='#TermsQuery'>TermsQuery</a>
Child of <a href='#Clause'>Clause</a>, <a href='#Query'>Query</a>, <a href='#CachedFilter'>CachedFilter</a>
</td></tr></table>
<p>Runs a Query and filters results to only those query matches that also match the Filter element.</p><p><span class='inTextTitle'>Example:</span> <em>Find all documents about Lucene that have a status of "published"</em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;UserQuery&gt;Lucene&lt;/UserQuery&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;TermsFilter fieldName="status"&gt;published&lt;/TermsFilter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;FilteredQuery&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;FilteredQuery&gt;'s children</th></tr>
@ -409,16 +409,16 @@ Child of <a href='#FilteredQuery'>FilteredQuery</a>
Child of <a href='#Clause'>Clause</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a>, <a href='#Filter'>Filter</a>, <a href='#CachedFilter'>CachedFilter</a>
</td></tr></table>
<p>Filter used to limit query results to documents matching a range of field values</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about banks from the last 10 years</em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;UserQuery&gt;bank&lt;/UserQuery&gt;
&lt;/Query&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/&gt;
&lt;/Filter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote>
</pre><p></p><blockquote>
<table summary="&lt;RangeFilter&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;RangeFilter&gt;'s attributes</th>
</tr>
@ -458,9 +458,9 @@ Attribute of <a href='#RangeFilter'>RangeFilter</a>
Child of <a href='#Clause'>Clause</a>, <a href='#Query'>Query</a>, <a href='#CachedFilter'>CachedFilter</a>
</td></tr></table>
<p>A Query that matches numeric values within a specified range.</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about people who are aged 20-25</em>
</p><pre>
</p><pre>
&lt;NumericRangeQuery fieldName="age" lowerTerm="20" upperTerm="25" /&gt;
</pre><p></p><blockquote>
</pre><p></p><blockquote>
<table summary="&lt;NumericRangeQuery&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;NumericRangeQuery&gt;'s attributes</th>
</tr>
@ -510,16 +510,16 @@ Attribute of <a href='#NumericRangeQuery'>NumericRangeQuery</a>
Child of <a href='#Clause'>Clause</a>, <a href='#ConstantScoreQuery'>ConstantScoreQuery</a>, <a href='#Filter'>Filter</a>, <a href='#CachedFilter'>CachedFilter</a>
</td></tr></table>
<p>A Filter that only accepts numeric values within a specified range</p><p><span class='inTextTitle'>Example:</span> <em>Search for documents about people who are aged 20-25</em>
</p><pre>
</p><pre>
&lt;FilteredQuery&gt;
&lt;Query&gt;
&lt;UserQuery&gt;person&lt;/UserQuery&gt;
&lt;/Query&gt;
&lt;/Query&gt;
&lt;Filter&gt;
&lt;NumericRangeFilter fieldName="age" lowerTerm="20" upperTerm="25"/&gt;
&lt;/Filter&gt;
&lt;/Filter&gt;
&lt;/FilteredQuery&gt;
</pre><p></p><blockquote>
</pre><p></p><blockquote>
<table summary="&lt;NumericRangeFilter&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;NumericRangeFilter&gt;'s attributes</th>
</tr>
@ -570,19 +570,19 @@ Child of <a href='#Include'>Include</a>, <a href='#Clause'>Clause</a>, <a href='
</td></tr></table>
<p>A single term used in a SpanQuery. These clauses are the building blocks for more complex "span" queries which test word proximity</p><p><span class='inTextTitle'>Example:</span> <em>Find documents using terms close to each other about mining and accidents</em>
</p><pre>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanTerm&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;SpanTerm&gt;'s attributes</th>
</tr>
@ -604,11 +604,11 @@ Child of <a href='#Include'>Include</a>, <a href='#Clause'>Clause</a>, <a href='
<p>A field-specific analyzer is used here to parse the child text provided in this tag. The SpanTerms produced are ORed in terms of Boolean logic</p><p><span class='inTextTitle'>Example:</span> <em>Use SpanOrTerms as a more convenient/succinct way of expressing multiple choices of SpanTerms. This example looks for reports
using words describing a fatality near to references to miners</em>
</p><pre>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOrTerms&gt;killed died death dead deaths&lt;/SpanOrTerms&gt;
&lt;SpanOrTerms&gt;miner mining miners&lt;/SpanOrTerms&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOrTerms&gt;killed died death dead deaths&lt;/SpanOrTerms&gt;
&lt;SpanOrTerms&gt;miner mining miners&lt;/SpanOrTerms&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanOrTerms&gt;'s attributes"><tr>
<th class='title' colspan='3'>&lt;SpanOrTerms&gt;'s attributes</th>
</tr>
@ -629,19 +629,19 @@ Child of <a href='#Include'>Include</a>, <a href='#Clause'>Clause</a>, <a href='
</td></tr></table>
<p>Takes any number of child queries from the Span family</p><p><span class='inTextTitle'>Example:</span> <em>Find documents using terms close to each other about mining and accidents</em>
</p><pre>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanOr&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;SpanOr&gt;'s children</th></tr>
@ -692,19 +692,19 @@ Attribute of <a href='#SpanNear'>SpanNear</a>
</td></tr></table>
<p>defines the maximum distance between Span elements where distance is expressed as word number, not byte offset</p><p><span class='inTextTitle'>Example:</span> <em>Find documents using terms within 8 words of each other talking about mining and accidents</em>
</p><pre>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><p><span class='inTextTitle'>Required</span></p><a name='SpanNear_inOrder'></a>
&lt;SpanNear slop="8" inOrder="false" fieldName="text"&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;killed&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;died&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;dead&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;SpanOr&gt;
&lt;SpanTerm&gt;miner&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;mining&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;miners&lt;/SpanTerm&gt;
&lt;/SpanOr&gt;
&lt;/SpanNear&gt;
</pre><p></p><p><span class='inTextTitle'>Required</span></p><a name='SpanNear_inOrder'></a>
<br /><table class='attributeTitle' summary="inOrder"><tr><td class='leftAttributeTitle'>
@inOrder</td><td class='rightAttributeTitle'>
Attribute of <a href='#SpanNear'>SpanNear</a>
@ -715,11 +715,11 @@ Attribute of <a href='#SpanNear'>SpanNear</a>
Child of <a href='#Include'>Include</a>, <a href='#Clause'>Clause</a>, <a href='#Query'>Query</a>, <a href='#SpanNear'>SpanNear</a>, <a href='#SpanOr'>SpanOr</a>, <a href='#Exclude'>Exclude</a>, <a href='#CachedFilter'>CachedFilter</a>
</td></tr></table>
<p>Looks for a SpanQuery match occuring near the beginning of a document</p><p><span class='inTextTitle'>Example:</span> <em>Find letters where the first 50 words talk about a resignation:</em>
</p><pre>
&lt;SpanFirst end="50"&gt;
&lt;SpanOrTerms fieldName="text"&gt;resigning resign leave&lt;/SpanOrTerms&gt;
&lt;/SpanFirst&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</p><pre>
&lt;SpanFirst end="50"&gt;
&lt;SpanOrTerms fieldName="text"&gt;resigning resign leave&lt;/SpanOrTerms&gt;
&lt;/SpanFirst&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanFirst&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;SpanFirst&gt;'s children</th></tr>
@ -761,16 +761,16 @@ Child of <a href='#Include'>Include</a>, <a href='#Clause'>Clause</a>, <a href='
</p><pre>
&lt;SpanNot fieldName="text"&gt;
&lt;Include&gt;
&lt;SpanNear slop="2" inOrder="true"&gt;
&lt;SpanNear slop="2" inOrder="true"&gt;
&lt;SpanTerm&gt;social&lt;/SpanTerm&gt;
&lt;SpanTerm&gt;services&lt;/SpanTerm&gt;
&lt;/SpanNear&gt;
&lt;/SpanNear&gt;
&lt;/Include&gt;
&lt;Exclude&gt;
&lt;SpanTerm&gt;public&lt;/SpanTerm&gt;
&lt;/Exclude&gt;
&lt;/SpanNot&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;SpanNot&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;SpanNot&gt;'s children</th></tr>
@ -832,8 +832,8 @@ Child of <a href='#Clause'>Clause</a>, <a href='#Query'>Query</a>, <a href='#Cac
</p><pre>
&lt;ConstantScoreQuery&gt;
&lt;RangeFilter fieldName="date" lowerTerm="19970101" upperTerm="20070101"/&gt;
&lt;/ConstantScoreQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
&lt;/ConstantScoreQuery&gt;
</pre><p></p><blockquote><table summary='element info'><tr>
<td class='construct'><table summary="&lt;ConstantScoreQuery&gt;'s children">
<thead>
<tr><th class='title' colspan='2'>&lt;ConstantScoreQuery&gt;'s children</th></tr>

View File

@ -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.

View File

@ -1,7 +1,7 @@
/* Generated By:JavaCC: Do not edit this line. StandardSyntaxParser.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.
@ -708,6 +708,16 @@ public class StandardSyntaxParser implements SyntaxParser, StandardSyntaxParserC
finally { jj_save(1, xla); }
}
private boolean jj_3R_12() {
if (jj_scan_token(RANGEIN_START)) return true;
return false;
}
private boolean jj_3R_11() {
if (jj_scan_token(REGEXPTERM)) return true;
return false;
}
private boolean jj_3_1() {
if (jj_scan_token(TERM)) return true;
Token xsp;
@ -811,16 +821,6 @@ public class StandardSyntaxParser implements SyntaxParser, StandardSyntaxParserC
return false;
}
private boolean jj_3R_12() {
if (jj_scan_token(RANGEIN_START)) return true;
return false;
}
private boolean jj_3R_11() {
if (jj_scan_token(REGEXPTERM)) return true;
return false;
}
/** Generated Token Manager. */
public StandardSyntaxParserTokenManager token_source;
/** Current token. */

View File

@ -1,7 +1,3 @@
/**
* Standard file is based on the TextParser.jj from lucene 2.3
*/
options {
STATIC=false;
JAVA_UNICODE_ESCAPE=true;
@ -13,7 +9,7 @@ options {
PARSER_BEGIN(StandardSyntaxParser)
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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -63,8 +63,8 @@ It's currently divided in 2 main packages:
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

View File

@ -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&nbsp;[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&nbsp;[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;

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

Some files were not shown because too many files have changed in this diff Show More