public final class SearchEvent
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
SearchEvent.ImageResult |
private class |
SearchEvent.RWIProcess |
Modifier and Type | Field and Description |
---|---|
boolean |
addResultsToLocalIndex |
private boolean |
addRunning |
ScoreMap<java.lang.String> |
authorNavigator |
ScoreMap<java.lang.String> |
collectionNavigator |
ScoreMap<java.lang.String> |
dateNavigator |
private boolean |
deleteIfSnippetFail |
private java.util.concurrent.ConcurrentHashMap<java.lang.String,WeakPriorityBlockingQueue<WordReferenceVars>> |
doubleDomCache |
private long |
eventTime |
boolean |
excludeintext_image |
private java.util.concurrent.atomic.AtomicInteger |
expectedRemoteReferences |
private java.util.concurrent.atomic.AtomicInteger |
feedersAlive |
private java.util.concurrent.atomic.AtomicInteger |
feedersTerminated |
ScoreMap<java.lang.String> |
filetypeNavigator |
private int[] |
flagcount |
private java.util.SortedMap<byte[],HeuristicResult> |
heuristics |
ScoreMap<java.lang.String> |
hostNavigator |
private java.util.SortedMap<byte[],java.lang.Integer> |
IACount |
private byte[] |
IAmaxcounthash |
private byte[] |
IAneardhthash |
private java.util.SortedMap<byte[],java.lang.String> |
IAResults |
private int |
imagePageCounter |
private java.util.LinkedHashMap<java.lang.String,SearchEvent.ImageResult> |
imageSpareBad |
private java.util.LinkedHashMap<java.lang.String,SearchEvent.ImageResult> |
imageSpareGood |
private java.util.LinkedHashMap<java.lang.String,SearchEvent.ImageResult> |
imageViewed |
ScoreMap<java.lang.String> |
languageNavigator |
private static java.util.regex.Pattern |
lettermatch |
private LoaderDispatcher |
loader |
java.util.concurrent.atomic.AtomicInteger |
local_rwi_available |
java.util.concurrent.atomic.AtomicInteger |
local_rwi_stored |
java.util.concurrent.atomic.AtomicInteger |
local_solr_available |
java.util.concurrent.atomic.AtomicInteger |
local_solr_stored |
private java.util.SortedMap<byte[],ReferenceContainer<WordReference>> |
localSearchInclusion |
private int |
localsolroffset |
java.lang.Thread |
localsolrsearch |
ScoreMap<java.lang.String> |
locationNavigator |
static ConcurrentLog |
log |
private static int |
max_results_node |
private static int |
max_results_rwi |
private static int |
MAX_TOPWORDS |
private java.util.concurrent.atomic.AtomicInteger |
maxExpectedRemoteReferences |
private long |
maxtime |
ScoreMap<java.lang.String> |
namespaceNavigator |
java.util.List<java.lang.Thread> |
nodeSearchThreads |
private WeakPriorityBlockingQueue<URIMetadataNode> |
nodeStack |
private ReferenceOrder |
order |
SeedDB |
peers |
private boolean |
pollImmediately |
java.util.SortedSet<byte[]> |
preselectedPeerHashes |
java.util.List<RemoteSearch> |
primarySearchThreadsL |
ScoreMap<java.lang.String> |
protocolNavigator |
QueryParams |
query |
private java.util.concurrent.atomic.AtomicInteger |
receivedRemoteReferences |
private ScoreMap<java.lang.String> |
ref |
private boolean |
remote |
java.util.concurrent.atomic.AtomicInteger |
remote_rwi_available |
java.util.concurrent.atomic.AtomicInteger |
remote_rwi_peerCount |
java.util.concurrent.atomic.AtomicInteger |
remote_rwi_stored |
java.util.concurrent.atomic.AtomicInteger |
remote_solr_available |
java.util.concurrent.atomic.AtomicInteger |
remote_solr_peerCount |
java.util.concurrent.atomic.AtomicInteger |
remote_solr_stored |
private long |
remoteStoredDocMaxSize
Maximum size allowed (in kbytes) for a remote document result to be stored to local index
|
private WeakPriorityBlockingQueue<URIMetadataNode> |
resultList |
java.lang.Thread |
rwiProcess |
private WeakPriorityBlockingQueue<WordReferenceVars> |
rwiStack |
SecondarySearchSuperviser |
secondarySearchSuperviser |
java.lang.Thread[] |
secondarySearchThreads |
static int |
SNIPPET_MAX_LENGTH |
private long |
snippetComputationAllTime |
private java.util.concurrent.atomic.AtomicInteger |
snippetFetchAlive |
private HandleSet |
snippetFetchWordHashes |
private java.util.concurrent.ConcurrentHashMap<java.lang.String,java.util.LinkedHashSet<java.lang.String>> |
snippets |
private java.util.Map<java.lang.String,java.lang.String> |
taggingPredicates |
private int |
topicNavigatorCount |
private HandleSet |
urlhashes |
private long |
urlRetrievalAllTime |
java.util.Map<java.lang.String,ScoreMap<java.lang.String>> |
vocabularyNavigator |
(package private) WorkTables |
workTables |
Modifier | Constructor and Description |
---|---|
protected |
SearchEvent(QueryParams query,
SeedDB peers,
WorkTables workTables,
java.util.SortedSet<byte[]> preselectedPeerHashes,
boolean generateAbstracts,
LoaderDispatcher loader,
int remote_maxcount,
long remote_maxtime,
boolean deleteIfSnippetFail,
boolean addResultsToLocalIdx) |
Modifier and Type | Method and Description |
---|---|
java.util.Iterator<java.util.Map.Entry<byte[],java.lang.Integer>> |
abstractsCount() |
int |
abstractsCount(byte[] hash) |
java.lang.String |
abstractsString(byte[] hash) |
protected void |
addBegin() |
void |
addExpectedRemoteReferences(int x) |
void |
addFinalize() |
void |
addHeuristic(byte[] urlhash,
java.lang.String heuristicName,
boolean redundant) |
void |
addNodes(java.util.List<URIMetadataNode> nodeList,
java.util.Map<java.lang.String,ReversibleScoreMap<java.lang.String>> facets,
java.util.Map<java.lang.String,java.util.LinkedHashSet<java.lang.String>> solrsnippets,
boolean local,
java.lang.String resourceName,
int fullResource) |
void |
addResult(URIMetadataNode resultEntry,
float score)
place the result to the result vector and apply post-ranking
post-ranking is added to the current score,
|
protected boolean |
addRunning() |
int |
addRWIs(ReferenceContainer<WordReference> index,
boolean local,
java.lang.String resourceName,
int fullResource,
long maxtime) |
void |
addTopic(java.lang.String[] words) |
protected void |
addTopics(URIMetadataNode resultEntry) |
protected void |
cleanup() |
java.util.ArrayList<WeakPriorityBlockingQueue.Element<URIMetadataNode>> |
completeResults(long waitingtime) |
private boolean |
containsSpare(java.lang.String id) |
protected boolean |
delete(java.lang.String urlhash)
delete a specific entry from the search results
this is used if the user clicks on a '-' sign beside the search result
|
boolean |
drainStacksToResult() |
protected boolean |
feedingIsFinished() |
int[] |
flagCount() |
byte[] |
getAbstractsMaxCountHash() |
byte[] |
getAbstractsNearDHTHash() |
long |
getEventTime() |
HeuristicResult |
getHeuristic(byte[] urlhash) |
ReferenceOrder |
getOrder() |
java.util.List<RemoteSearch> |
getPrimarySearchThreads() |
QueryParams |
getQuery() |
long |
getRemoteDocStoredMaxSize() |
int |
getResultCount() |
java.lang.Thread[] |
getSecondarySearchThreads() |
URIMetadataNode |
getSnippet(URIMetadataNode page,
CacheStrategy cacheStrategy) |
long |
getSnippetComputationTime() |
ScoreMap<java.lang.String> |
getTopicNavigator(int count) |
ScoreMap<java.lang.String> |
getTopics(int maxcount,
long maxtime) |
long |
getURLRetrievalTime() |
private boolean |
hasSpare() |
private SearchEvent.ImageResult |
nextSpare() |
private SearchEvent.ImageResult |
nthImage(int item) |
void |
oneFeederStarted() |
void |
oneFeederTerminated()
method to signal the incoming stack that one feeder has terminated
|
SearchEvent.ImageResult |
oneImageResult(int item,
long timeout) |
URIMetadataNode |
oneResult(int item,
long timeout) |
private long |
postRanking(URIMetadataNode rentry,
ScoreMap<java.lang.String> topwords) |
URIMetadataNode |
pullOneFilteredFromRWI(boolean skipDoubleDom)
get one metadata entry from the ranked results.
|
private URIMetadataNode |
pullOneRWI(boolean skipDoubleDom)
Take one best entry from the rwiStack and create a node entry out of it.
|
protected void |
resetEventTime() |
boolean |
rwiIsEmpty() |
protected int |
rwiQueueSize() |
protected java.util.Map<byte[],ReferenceContainer<WordReference>> |
searchContainerMap() |
void |
setRemoteDocStoredMaxSize(long maxSize)
Set maximum size allowed (in kbytes) for a remote document result to be stored to local index.
|
private int |
sizeSpare() |
protected boolean |
testFlags(Bitfield flags) |
private static final int max_results_rwi
private static final int max_results_node
public static final ConcurrentLog log
public static final int SNIPPET_MAX_LENGTH
private static final int MAX_TOPWORDS
private long eventTime
public QueryParams query
public final SeedDB peers
final WorkTables workTables
public final SecondarySearchSuperviser secondarySearchSuperviser
public final java.util.List<RemoteSearch> primarySearchThreadsL
public final java.util.List<java.lang.Thread> nodeSearchThreads
public java.lang.Thread[] secondarySearchThreads
public final java.util.SortedSet<byte[]> preselectedPeerHashes
private final java.util.SortedMap<byte[],java.lang.Integer> IACount
private final java.util.SortedMap<byte[],java.lang.String> IAResults
private final java.util.SortedMap<byte[],HeuristicResult> heuristics
private byte[] IAmaxcounthash
private byte[] IAneardhthash
public java.lang.Thread rwiProcess
public java.lang.Thread localsolrsearch
private int localsolroffset
private final java.util.concurrent.atomic.AtomicInteger expectedRemoteReferences
private final java.util.concurrent.atomic.AtomicInteger maxExpectedRemoteReferences
public final ScoreMap<java.lang.String> locationNavigator
public final ScoreMap<java.lang.String> hostNavigator
public final ScoreMap<java.lang.String> authorNavigator
public final ScoreMap<java.lang.String> collectionNavigator
public final ScoreMap<java.lang.String> namespaceNavigator
public final ScoreMap<java.lang.String> protocolNavigator
public final ScoreMap<java.lang.String> filetypeNavigator
public final ScoreMap<java.lang.String> dateNavigator
public final ScoreMap<java.lang.String> languageNavigator
public final java.util.Map<java.lang.String,ScoreMap<java.lang.String>> vocabularyNavigator
private final int topicNavigatorCount
private final LoaderDispatcher loader
private final HandleSet snippetFetchWordHashes
private final boolean deleteIfSnippetFail
private long urlRetrievalAllTime
private long snippetComputationAllTime
private java.util.concurrent.ConcurrentHashMap<java.lang.String,java.util.LinkedHashSet<java.lang.String>> snippets
private final boolean remote
public final boolean addResultsToLocalIndex
private long remoteStoredDocMaxSize
private java.util.SortedMap<byte[],ReferenceContainer<WordReference>> localSearchInclusion
private final ScoreMap<java.lang.String> ref
private final long maxtime
private final java.util.concurrent.ConcurrentHashMap<java.lang.String,WeakPriorityBlockingQueue<WordReferenceVars>> doubleDomCache
private final int[] flagcount
private final java.util.concurrent.atomic.AtomicInteger feedersAlive
private final java.util.concurrent.atomic.AtomicInteger feedersTerminated
private final java.util.concurrent.atomic.AtomicInteger snippetFetchAlive
private boolean addRunning
private final java.util.concurrent.atomic.AtomicInteger receivedRemoteReferences
private final ReferenceOrder order
private final HandleSet urlhashes
private final java.util.Map<java.lang.String,java.lang.String> taggingPredicates
private final WeakPriorityBlockingQueue<WordReferenceVars> rwiStack
private final WeakPriorityBlockingQueue<URIMetadataNode> nodeStack
private final WeakPriorityBlockingQueue<URIMetadataNode> resultList
private final boolean pollImmediately
public final boolean excludeintext_image
public final java.util.concurrent.atomic.AtomicInteger local_rwi_available
public final java.util.concurrent.atomic.AtomicInteger local_rwi_stored
public final java.util.concurrent.atomic.AtomicInteger remote_rwi_available
public final java.util.concurrent.atomic.AtomicInteger remote_rwi_stored
public final java.util.concurrent.atomic.AtomicInteger remote_rwi_peerCount
public final java.util.concurrent.atomic.AtomicInteger local_solr_available
public final java.util.concurrent.atomic.AtomicInteger local_solr_stored
public final java.util.concurrent.atomic.AtomicInteger remote_solr_available
public final java.util.concurrent.atomic.AtomicInteger remote_solr_stored
public final java.util.concurrent.atomic.AtomicInteger remote_solr_peerCount
private int imagePageCounter
private java.util.LinkedHashMap<java.lang.String,SearchEvent.ImageResult> imageViewed
private java.util.LinkedHashMap<java.lang.String,SearchEvent.ImageResult> imageSpareGood
private java.util.LinkedHashMap<java.lang.String,SearchEvent.ImageResult> imageSpareBad
private static final java.util.regex.Pattern lettermatch
protected SearchEvent(QueryParams query, SeedDB peers, WorkTables workTables, java.util.SortedSet<byte[]> preselectedPeerHashes, boolean generateAbstracts, LoaderDispatcher loader, int remote_maxcount, long remote_maxtime, boolean deleteIfSnippetFail, boolean addResultsToLocalIdx)
public int getResultCount()
public void setRemoteDocStoredMaxSize(long maxSize)
maxSize
- document content max size in kbytes. Zero or negative value means no limit.public long getRemoteDocStoredMaxSize()
public int addRWIs(ReferenceContainer<WordReference> index, boolean local, java.lang.String resourceName, int fullResource, long maxtime)
public long getEventTime()
protected void resetEventTime()
protected void cleanup()
public java.lang.String abstractsString(byte[] hash)
public java.util.Iterator<java.util.Map.Entry<byte[],java.lang.Integer>> abstractsCount()
public int abstractsCount(byte[] hash)
public byte[] getAbstractsMaxCountHash()
public byte[] getAbstractsNearDHTHash()
public java.util.List<RemoteSearch> getPrimarySearchThreads()
public java.lang.Thread[] getSecondarySearchThreads()
public void addHeuristic(byte[] urlhash, java.lang.String heuristicName, boolean redundant)
public HeuristicResult getHeuristic(byte[] urlhash)
public void addNodes(java.util.List<URIMetadataNode> nodeList, java.util.Map<java.lang.String,ReversibleScoreMap<java.lang.String>> facets, java.util.Map<java.lang.String,java.util.LinkedHashSet<java.lang.String>> solrsnippets, boolean local, java.lang.String resourceName, int fullResource)
public void addExpectedRemoteReferences(int x)
private URIMetadataNode pullOneRWI(boolean skipDoubleDom)
skipDoubleDom
- public URIMetadataNode pullOneFilteredFromRWI(boolean skipDoubleDom)
skipDoubleDom
- should be true if it is wanted that double domain entries are skippedpublic long getURLRetrievalTime()
public long getSnippetComputationTime()
public ScoreMap<java.lang.String> getTopicNavigator(int count)
public boolean drainStacksToResult()
public void addResult(URIMetadataNode resultEntry, float score)
resultEntry
- to addscore
- current rankingprivate long postRanking(URIMetadataNode rentry, ScoreMap<java.lang.String> topwords)
public URIMetadataNode getSnippet(URIMetadataNode page, CacheStrategy cacheStrategy)
public URIMetadataNode oneResult(int item, long timeout)
private SearchEvent.ImageResult nthImage(int item)
private boolean hasSpare()
private boolean containsSpare(java.lang.String id)
private int sizeSpare()
private SearchEvent.ImageResult nextSpare()
public SearchEvent.ImageResult oneImageResult(int item, long timeout) throws java.net.MalformedURLException
java.net.MalformedURLException
public java.util.ArrayList<WeakPriorityBlockingQueue.Element<URIMetadataNode>> completeResults(long waitingtime)
protected boolean delete(java.lang.String urlhash)
urlhash
- public ReferenceOrder getOrder()
protected boolean feedingIsFinished()
public void oneFeederTerminated()
public void oneFeederStarted()
public QueryParams getQuery()
public int[] flagCount()
protected void addBegin()
public void addFinalize()
protected boolean addRunning()
public boolean rwiIsEmpty()
protected int rwiQueueSize()
protected boolean testFlags(Bitfield flags)
protected java.util.Map<byte[],ReferenceContainer<WordReference>> searchContainerMap()
public ScoreMap<java.lang.String> getTopics(int maxcount, long maxtime)
public void addTopic(java.lang.String[] words)
protected void addTopics(URIMetadataNode resultEntry)