mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-21 00:00:13 +02:00
788288eb9e
The default schema uses only some of them and the resting search index has now the following properties: - webgraph size will have about 40 times as much entries as default index - the complete index size will increase and may be about the double size of current amount As testing showed, not much indexing performance is lost. The default index will be smaller (moved fields out of it); thus searching can be faster. The new index will cause that some old parts in YaCy can be removed, i.e. specialized webgraph data and the noload crawler. The new index will make it possible to: - search within link texts of linked but not indexed documents (about 20 times of document index in size!!) - get a very detailed link graph - enhance ranking using a complete link graph To get the full access to the new index, the API to solr has now two access points: one with attribute core=collection1 for the default search index and core=webgraph to the new webgraph search index. This is also avaiable for p2p operation but client access is not yet implemented.
80 lines
2.8 KiB
Java
80 lines
2.8 KiB
Java
/**
|
|
* EmbedEntry
|
|
* Copyright 2012 by Michael Peter Christen, mc@yacy.net, Frankfurt am Main, Germany
|
|
* First released 27.04.2012 at http://yacy.net
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with this program in the file lgpl21.txt
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
package net.yacy.document.parser.html;
|
|
|
|
import net.yacy.kelondro.data.meta.DigestURI;
|
|
|
|
public class EmbedEntry {
|
|
|
|
private final DigestURI url;
|
|
private final int width, height;
|
|
private final String type, pluginspage;
|
|
|
|
public EmbedEntry(final DigestURI url, int width, int height, String type, String pluginspage) {
|
|
this.url = url;
|
|
this.width = width;
|
|
this.height = height;
|
|
this.type = type;
|
|
this.pluginspage = pluginspage;
|
|
}
|
|
|
|
public DigestURI getUrl() {
|
|
return this.url;
|
|
}
|
|
|
|
public final int getWidth() {
|
|
return this.width;
|
|
}
|
|
|
|
public final int getHeight() {
|
|
return this.height;
|
|
}
|
|
|
|
public final String getType() {
|
|
return this.type;
|
|
}
|
|
|
|
public final String getPluginspage() {
|
|
return this.pluginspage;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "<embed url=\"" + this.url.toNormalform(false) + "\"" +
|
|
(this.type != null && this.type.length() > 0 ? " type=\"" + this.type + "\"" : "") +
|
|
(this.pluginspage != null && this.pluginspage.length() > 0 ? " pluginspage=\"" + this.pluginspage + "\"" : "") +
|
|
(this.width >= 0 ? " width=\"" + this.width + "\"" : "") +
|
|
(this.height >= 0 ? " height=\"" + this.height + "\"" : "") +
|
|
">";
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
// if htmlFilterImageEntry elements are stored in a TreeSet, the biggest images shall be listed first
|
|
// this hash method therefore tries to compute a 'perfect hash' based on the size of the images
|
|
// unfortunately it can not be ensured that all images get different hashes, but this should appear
|
|
// only in very rare cases
|
|
if (this.width < 0 || this.height < 0)
|
|
return /*0x7FFF0000 |*/ (this.url.hashCode() & 0xFFFF);
|
|
return ((0x7FFF - (((this.width * this.height) >> 9) & 0x7FFF)) << 16) | (this.url.hashCode() & 0xFFFF);
|
|
}
|
|
}
|