Merge branch 'master' of ssh://git@gitorious.org/yacy/rc1.git

pull/1/head
Michael Peter Christen 11 years ago
commit c63e93df46

@ -58,7 +58,7 @@
<div class="input-group">
<input name="query" id="search" type="text" size="40" maxlength="80" value="#[former]#" onFocus="this.select()" class="form-control searchinput typeahead" />
<div class="input-group-btn">
<button name="query" id="Enter" class="btn btn-primary">Search</button>
<button type="submit" id="Enter" class="btn btn-primary">Search</button>
</div>
</div>
<input type="hidden" name="verify" value="#[search.verify]#" />

@ -2,15 +2,11 @@
# THIS SCRIPT CAN BE USED TO EDIT SOME BASIC SETTINGS OF YACY
#
# Copyright 2009 by Marc Nause; marc.nause@gmx.de
# Copyright 2009 - 2014 by Marc Nause; marc.nause@gmx.de
#
# This is a part of YaCy, a peer-to-peer based web search engine.
# http://www.yacy.net
#
# $LastChangedDate$
# $LastChangedRevision$
# $LastChangedBy$
#
# LICENSE
#
# This program is free software; you can redistribute it and/or modify
@ -158,10 +154,10 @@ change_mem_settings()
esac
}
# CHANGES THE PORT SETTINGS
# CHANGES THE PORT SETTINGS. PROPERTY NAME IN FIRST PARAMETER, HUMAN READABLE NAME IN SECOND PARAMETER.
change_port_settings()
{
if read_parameter 'port'
if read_parameter $1
then
CURRENTPORT="$REPLY"
else
@ -169,19 +165,19 @@ change_port_settings()
fi
echo
echo -n "Which port do you want YaCy to use (currently $CURRENTPORT)? "
echo -n "Which port do you want YaCy to use for $2 (currently $CURRENTPORT)? "
read INPUT
case $INPUT in
[0-9]*)
if [ "$INPUT" -ge 1024 ] && [ "$INPUT" -le 65535 ];
then
replace_parameter 'port' $INPUT
STATUS="Port settings have been changed. YaCy listens to port $INPUT now."
replace_parameter $1 $INPUT
STATUS="Port settings for $2 have been changed. YaCy listens to port $INPUT now."
else
echo
echo 'Please use choose a number between 1024 and 65535.'
change_port_settings
change_port_settings $1 $2
fi
;;
'')
@ -190,7 +186,7 @@ change_port_settings()
*)
echo
echo 'Please enter a number or just hit enter to abort.'
change_port_settings
change_port_settings $1 $2
;;
esac
}
@ -249,7 +245,8 @@ print_menu()
echo "Make your choice:"
echo "[1] change memory settings"
echo "[2] change admin password"
echo "[3] change port"
echo "[3] change HTTP port"
echo "[4] change HTTPS port"
echo "[0] quit"
echo
echo "Status: $STATUS"
@ -259,7 +256,7 @@ print_menu()
# IF A SECOND PARAMETER, WHICH IS A VALID sed OPERATION LIKE "s/xxx/yyy/", EXISTS.
read_parameter()
{
REPLY="`cat "$CONFIGFILE" | grep "^$1" | sed "s/\(^$1 *= *\)\(.*\)$/\2/"`"
REPLY="`cat "$CONFIGFILE" | grep "^$1=" | sed "s/\(^$1 *= *\)\(.*\)$/\2/"`"
if [ "$2" != '' ]
then
REPLY="`echo "$REPLY" | sed $2`"
@ -295,7 +292,10 @@ do
change_admin_settings
;;
3)
change_port_settings
change_port_settings 'port' 'HTTP'
;;
4)
change_port_settings 'port.ssl' 'HTTPS'
;;
esac
print_menu

@ -225,12 +225,7 @@ public class MultiProtocolURL implements Serializable, Comparable<MultiProtocolU
// no host given
this.path = h.substring(2); // "/path" or "/c:/path"
} else if (h.startsWith("//")) { // "//host/path" or "//host/c:/path"
int q = url.indexOf('/', p + 3);
if (q < 0) {
this.path = "/";
} else {
this.path = url.substring(q);
}
this.path = h.substring(2); // "/path" or "/c:/path"
} else if (h.startsWith("/")) { // "/host/path" or "/host/c:/path"
this.path = h;
}
@ -2196,6 +2191,7 @@ public class MultiProtocolURL implements Serializable, Comparable<MultiProtocolU
*/
public static void main(final String[] args) {
final String[][] test = new String[][]{
new String[]{null, "file://Z:\\"},
new String[]{null, "https://www.example.com/shoe/?p=2&ps=75#t={%22san_NaviPaging%22:2}"}, // ugly strange pagination link
new String[]{null, "C:WINDOWS\\CMD0.EXE"},
new String[]{null, "file://C:WINDOWS\\CMD0.EXE"},

@ -149,7 +149,7 @@ public class OpensearchResponseWriter implements QueryResponseWriter {
solitaireTag(writer, "opensearch:startIndex", Integer.toString(resHead.offset));
solitaireTag(writer, "opensearch:itemsPerPage", Integer.toString(resHead.rows));
solitaireTag(writer, RSSMessage.Token.title.name(), this.title);
writer.write("<atom:link rel=\"search\" href=\"http://localhost:8090/opensearchdescription.xml\" type=\"application/opensearchdescription+xml\"/>");
writer.write("<atom:link rel=\"search\" href=\"/opensearchdescription.xml\" type=\"application/opensearchdescription+xml\"/>");
solitaireTag(writer, "description", "Search Result");
//solitaireTag(writer, "link", "");
//solitaireTag(writer, "image", "");

@ -116,9 +116,9 @@ public class FileLoader {
// only the metadata is returned
if (parserError != null) {
this.log.info("No parser available in File crawler: '" + parserError + "' for URL " + request.url().toString() + ": parsing only metadata");
this.log.info("No parser available in File crawler: '" + parserError + "' for URL " + request.url().toNormalform(false) + ": parsing only metadata");
} else {
this.log.info("Too big file in File crawler with size = " + size + " Bytes for URL " + request.url().toString() + ": parsing only metadata");
this.log.info("Too big file in File crawler with size = " + size + " Bytes for URL " + request.url().toNormalform(false) + ": parsing only metadata");
}
// create response with metadata only

@ -34,7 +34,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
@ -49,7 +48,6 @@ import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.federate.solr.Ranking;
import net.yacy.cora.language.synonyms.SynonymLibrary;
import net.yacy.cora.lod.vocabulary.Tagging;
import net.yacy.cora.order.NaturalOrder;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.document.language.Identificator;
import net.yacy.document.parser.html.ImageEntry;
@ -75,7 +73,7 @@ public final class Condenser {
public static final int flag_cat_hasapp = 23; // the page refers to (at least one) application file
//private Properties analysis;
private final SortedMap<String, Word> words; // a string (the words) to (indexWord) - relation
private final Map<String, Word> words; // a string (the words) to (indexWord) - relation
private final Map<String, Set<Tagging.Metatag>> tags = new HashMap<String, Set<Tagging.Metatag>>(); // a set of tags, discovered from Autotagging
private final Set<String> synonyms; // a set of synonyms to the words
private long fuzzy_signature = 0, exact_signature = 0; // signatures for double-check detection
@ -99,7 +97,7 @@ public final class Condenser {
Thread.currentThread().setName("condenser-" + document.dc_identifier()); // for debugging
// if addMedia == true, then all the media links are also parsed and added to the words
// added media words are flagged with the appropriate media flag
this.words = new TreeMap<String, Word>(NaturalOrder.naturalComparator);
this.words = new HashMap<String, Word>();
this.synonyms = new LinkedHashSet<String>();
this.RESULT_FLAGS = new Bitfield(4);
@ -212,7 +210,7 @@ public final class Condenser {
wprop = we.getValue();
if (wprop.flags == null) {
wprop.flags = this.RESULT_FLAGS.clone();
this.words.put(we.getKey(), wprop);
this.words.put(we.getKey().toLowerCase(), wprop);
}
}
}
@ -274,7 +272,7 @@ public final class Condenser {
if (wprop == null) wprop = new Word(0, pip, phrase);
if (wprop.flags == null) wprop.flags = flagstemplate.clone();
wprop.flags.set(flagpos, true);
this.words.put(word, wprop);
this.words.put(word.toLowerCase(), wprop);
pip++;
this.RESULT_NUMB_WORDS++;
this.RESULT_DIFF_WORDS++;
@ -293,7 +291,7 @@ public final class Condenser {
return oldsize - this.words.size();
}
public SortedMap<String, Word> words() {
public Map<String, Word> words() {
// returns the words as word/indexWord relation map
return this.words;
}
@ -409,7 +407,7 @@ public final class Condenser {
wordHandle = wordHandleCount++;
wsp = new Word(wordHandle, wordInSentenceCounter, sentences.size() + 100);
wsp.flags = this.RESULT_FLAGS.clone();
this.words.put(word, wsp);
this.words.put(word.toLowerCase(), wsp);
}
// we now have the unique handle of the word, put it into the sentence:
wordInSentenceCounter++;
@ -454,7 +452,7 @@ public final class Condenser {
this.RESULT_DIFF_SENTENCES = sentenceHandleCount;
}
public static SortedMap<String, Word> getWords(final String text, final WordCache meaningLib) {
public static Map<String, Word> getWords(final String text, final WordCache meaningLib) {
// returns a word/indexWord relation map
if (text == null) return null;
return new Condenser(text, meaningLib, false).words();

Loading…
Cancel
Save