Merge origin/master

pull/1/head
reger 11 years ago
commit 7d6b34a89f

@ -10,8 +10,6 @@
<classpathentry kind="src" path="htroot/api/bookmarks/posts"/>
<classpathentry kind="src" path="htroot/api/bookmarks/tags"/>
<classpathentry kind="src" path="htroot/api/bookmarks/xbel"/>
<classpathentry excluding="collection1/" kind="src" path="htroot/solr"/>
<classpathentry kind="src" path="htroot/gsa"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/jetty-continuation-8.1.13.v20130916.jar"/>
<classpathentry kind="lib" path="lib/jetty-http-8.1.13.v20130916.jar"/>
@ -26,8 +24,8 @@
<classpathentry kind="lib" path="lib/webcat-0.1-swf.jar"/>
<classpathentry kind="lib" path="lib/activation.jar"/>
<classpathentry kind="lib" path="lib/commons-jxpath-1.3.jar"/>
<classpathentry kind="lib" path="lib/poi-3.6-20091214.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.6-20091214.jar"/>
<classpathentry kind="lib" path="lib/poi-3.9-20121203.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-3.9-20121203.jar"/>
<classpathentry kind="lib" path="lib/bcmail-jdk15-145.jar"/>
<classpathentry kind="lib" path="lib/bcprov-jdk15-145.jar"/>
<classpathentry kind="lib" path="lib/jsch-0.1.50.jar"/>

@ -370,7 +370,12 @@ public class yacysearch {
int stp = querystring.indexOf('*');
if (stp >= 0) {
querystring = querystring.substring(0, stp) + Segment.catchallString + querystring.substring(stp + 1);
// if the star appears as a single entry, use the catchallstring
if (querystring.length() == 1) {
querystring = Segment.catchallString;
} else {
querystring = querystring.replace('*', ' ').replaceAll(" ", " ");
}
}
if ( querystring.indexOf("/near", 0) >= 0 ) {
querystring = querystring.replace("/near", "");

@ -73,7 +73,7 @@
<compilation-unit>
<package-root>source</package-root>
<package-root>htroot</package-root>
<classpath mode="compile">lib/activation.jar;lib/apache-mime4j-0.6.jar;lib/arq-2.8.7.jar;lib/bcmail-jdk15-145.jar;lib/bcprov-jdk15-145.jar;lib/commons-codec-1.7.jar;lib/commons-compress-1.4.1.jar;lib/commons-fileupload-1.2.2.jar;lib/commons-httpclient-3.1.jar;lib/commons-io-2.1.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.1.3.jar;lib/fontbox-1.8.2.jar;lib/geronimo-stax-api_1.0_spec-1.0.1.jar;lib/guava-13.0.1.jar;lib/htmllexer.jar;lib/httpclient-4.3.1.jar;lib/httpcore-4.3.jar;lib/httpmime-4.3.1.jar;lib/icu4j-core.jar;lib/iri-0.8.jar;lib/J7Zip-modified.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.2.jar;lib/jempbox-1.8.2.jar;lib/jena-2.6.4.jar;lib/jsch-0.1.42.jar;lib/json-simple-1.1.jar;lib/jsoup-1.6.3.jar;lib/log4j-1.2.17.jar;lib/log4j-over-slf4j-1.7.2.jar;lib/lucene-analyzers-common-4.5.0.jar;lib/lucene-analyzers-phonetic-4.5.0.jar;lib/lucene-core-4.5.0.jar;lib/lucene-misc-4.5.0.jar;lib/lucene-spatial-4.5.0.jar;lib/metadata-extractor-2.6.2.jar;lib/mysql-connector-java-5.1.12-bin.jar;lib/pdfbox-1.8.2.jar;lib/poi-3.6-20091214.jar;lib/poi-scratchpad-3.6-20091214.jar;lib/sax-2.0.1.jar;lib/servlet-api-2.5-20081211.jar;lib/slf4j-api-1.7.2.jar;lib/slf4j-jdk14-1.7.2.jar;lib/solr-core-4.5.0.jar;lib/solr-solrj-4.5.0.jar;lib/spatial4j-0.3.jar;lib/webcat-0.1-swf.jar;lib/wstx-asl-3.2.7.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/zookeeper-3.4.5.jar</classpath>
<classpath mode="compile">lib/activation.jar;lib/apache-mime4j-0.6.jar;lib/arq-2.8.7.jar;lib/bcmail-jdk15-145.jar;lib/bcprov-jdk15-145.jar;lib/commons-codec-1.7.jar;lib/commons-compress-1.4.1.jar;lib/commons-fileupload-1.2.2.jar;lib/commons-httpclient-3.1.jar;lib/commons-io-2.1.jar;lib/commons-jxpath-1.3.jar;lib/commons-lang-2.6.jar;lib/commons-logging-1.1.3.jar;lib/fontbox-1.8.2.jar;lib/geronimo-stax-api_1.0_spec-1.0.1.jar;lib/guava-13.0.1.jar;lib/htmllexer.jar;lib/httpclient-4.3.1.jar;lib/httpcore-4.3.jar;lib/httpmime-4.3.1.jar;lib/icu4j-core.jar;lib/iri-0.8.jar;lib/J7Zip-modified.jar;lib/jakarta-oro-2.0.8.jar;lib/jaudiotagger-2.0.4-20111207.115108-15.jar;lib/jcifs-1.3.17.jar;lib/jcl-over-slf4j-1.7.2.jar;lib/jempbox-1.8.2.jar;lib/jena-2.6.4.jar;lib/jsch-0.1.42.jar;lib/json-simple-1.1.jar;lib/jsoup-1.6.3.jar;lib/log4j-1.2.17.jar;lib/log4j-over-slf4j-1.7.2.jar;lib/lucene-analyzers-common-4.5.0.jar;lib/lucene-analyzers-phonetic-4.5.0.jar;lib/lucene-core-4.5.0.jar;lib/lucene-misc-4.5.0.jar;lib/lucene-spatial-4.5.0.jar;lib/metadata-extractor-2.6.2.jar;lib/mysql-connector-java-5.1.12-bin.jar;lib/pdfbox-1.8.2.jar;lib/poi-3.9-20121203.jar;lib/poi-scratchpad-3.9-20121203.jar;lib/sax-2.0.1.jar;lib/servlet-api-2.5-20081211.jar;lib/slf4j-api-1.7.2.jar;lib/slf4j-jdk14-1.7.2.jar;lib/solr-core-4.5.0.jar;lib/solr-solrj-4.5.0.jar;lib/spatial4j-0.3.jar;lib/webcat-0.1-swf.jar;lib/wstx-asl-3.2.7.jar;lib/xercesImpl.jar;lib/xml-apis.jar;lib/zookeeper-3.4.5.jar</classpath>
<source-level>1.6</source-level>
</compilation-unit>
</java-data>

@ -53,6 +53,7 @@ public class docParser extends AbstractParser implements Parser {
this.SUPPORTED_MIME_TYPES.add("application/x-msword");
}
@SuppressWarnings("deprecation")
@Override
public Document[] parse(final AnchorURL location, final String mimeType,
final String charset, final InputStream source)

@ -142,7 +142,7 @@ public class YaCyDefaultServlet extends HttpServlet {
_mimeTypes = new MimeTypes();
String tmpstr = this.getServletContext().getInitParameter("welcomeFile");
if (tmpstr == null) {
_welcomes = new String[]{"index.html", "welcome.html"}; // set a default welcome file name
_welcomes = HTTPDFileHandler.defaultFiles;
} else {
_welcomes = new String[]{tmpstr,"index.html"};
}
@ -305,7 +305,7 @@ public class YaCyDefaultServlet extends HttpServlet {
} else { // resource is directory
String welcome;
if (!endsWithSlash || (pathInContext.length() == 1)) {
if (!endsWithSlash) {
StringBuffer buf = request.getRequestURL();
synchronized (buf) {
int param = buf.lastIndexOf(";");

@ -27,6 +27,7 @@ import org.apache.solr.common.params.MultiMapSolrParams;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.util.CommonPattern;
import net.yacy.search.index.Segment;
import net.yacy.search.schema.CollectionSchema;
import net.yacy.server.serverObjects;
@ -74,21 +75,11 @@ public class QueryModifier {
add("/file");
}
// parse 'common search mistakes' like guessed regular expressions
querystring = filetypeParser(querystring, "*");
// parse filetype
final int ftp = querystring.indexOf("filetype:", 0);
if ( ftp >= 0 ) {
int ftb = querystring.indexOf(' ', ftp);
if ( ftb == -1 ) {
ftb = querystring.length();
}
filetype = querystring.substring(ftp + 9, ftb);
querystring = querystring.replace("filetype:" + filetype, "");
while ( !filetype.isEmpty() && filetype.charAt(0) == '.' ) {
filetype = filetype.substring(1);
}
add("filetype:" + filetype);
if (filetype.isEmpty()) filetype = null;
}
querystring = filetypeParser(querystring, "filetype:");
// parse site
final int sp = querystring.indexOf("site:", 0);
@ -141,6 +132,23 @@ public class QueryModifier {
return querystring.trim();
}
private String filetypeParser(String querystring, final String filetypePrefix) {
final int ftp = querystring.indexOf(filetypePrefix, 0);
if ( ftp >= 0 ) {
int ftb = querystring.indexOf(' ', ftp);
if ( ftb < 0 ) ftb = querystring.length();
filetype = querystring.substring(ftp + filetypePrefix.length(), ftb);
querystring = querystring.replace(filetypePrefix + filetype, "");
while ( !filetype.isEmpty() && filetype.charAt(0) == '.' ) {
filetype = filetype.substring(1);
}
add("filetype:" + filetype);
if (filetype.isEmpty()) filetype = null;
if (querystring.length() == 0) querystring = "*";
}
return querystring;
}
public void add(String m) {
if (modifier.length() > 0 && modifier.charAt(modifier.length() - 1) != ' ' && m != null && m.length() > 0) modifier.append(' ');
if (m != null) modifier.append(m);

@ -73,7 +73,7 @@ public final class HTTPDFileHandler {
private static File htRootPath = null;
public static File htDocsPath = null;
private static String[] defaultFiles = null;
public static String[] defaultFiles = null;
private static File htDefaultPath = null;
private static File htLocalePath = null;
public static String indexForward = "";

Loading…
Cancel
Save