Commit ec36aa94 authored by reuschling's avatar reuschling
Browse files

bugfix: sorting with several indices. Solved for local indices, error

message for remote indices - there is no good way to solve this | new
document pool functionality


git-svn-id: https://dynaq.opendfki.de/repos/application/trunk@1047 8b50620d-ddf8-0310-9f5d-8b2f31fd9ac4
parent e5ffeb74
......@@ -28,7 +28,7 @@ import org.dynaq.index.LuceneIndexSet;
import de.dfki.inquisition.exceptions.ExceptionUtils;
import de.dfki.inquisition.lucene.IndexAccessor;
import de.dfki.inquisition.lucene.RemoteMultiIndexSearcher;
import de.dfki.inquisition.lucene.RemoteIndexSearcher;
import de.dfki.inquisition.text.StringUtils;
......@@ -352,7 +352,7 @@ public class DynaQResultList implements Iterable<ScoredDynaQDocument>
// Beim ersten Zugriff nehmen wir die DocPos im Index und merken uns die URI für diese Pos in der Ergebnisliste
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
int iDocIndexInIndex = this.m_luceneTopDocs.scoreDocs[iDocPositionInResultList].doc;
......@@ -744,7 +744,7 @@ public class DynaQResultList implements Iterable<ScoredDynaQDocument>
if(m_luceneIndexSet.getDefaultIndexPath() != null) IndexAccessor.refreshIndexReader(m_luceneIndexSet.getDefaultIndexPath(), true);
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
......
......@@ -47,7 +47,6 @@ import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JToggleButton;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.border.Border;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
......@@ -74,7 +73,7 @@ import au.com.bytecode.opencsv.CSVReader;
import au.com.bytecode.opencsv.CSVWriter;
import de.dfki.inquisition.file.FileUtils;
import de.dfki.inquisition.lucene.IndexAccessor;
import de.dfki.inquisition.lucene.RemoteMultiIndexReader;
import de.dfki.inquisition.lucene.RemoteIndexReader;
import de.dfki.inquisition.lucene.Term2FrequenciesEntry;
import de.dfki.inquisition.lucene.Term2FrequencyEntry;
import de.dfki.inquisition.text.StringUtils;
......@@ -286,7 +285,7 @@ public class DynaQDocumentPool extends JPanel implements ActionListener, RCPPers
// wir gehen jetzt alle Attribute durch und lesen jeweils die Statistiken durch
LuceneIndexSet luceneIndexSet = LuceneIndexSet.getServiceDefaultIndexSet();
RemoteMultiIndexReader multiIndexReader = IndexAccessor.getMultiIndexReader(luceneIndexSet.getIndexPaths());
RemoteIndexReader multiIndexReader = IndexAccessor.getMultiIndexReader(luceneIndexSet.getIndexPaths());
LinkedList<String> lAttNames2Show = new LinkedList<>();
......
......@@ -54,8 +54,6 @@ import de.dfki.inquisition.file.FileUtils;
import de.dfki.inquisition.lucene.IndexAccessor;
import de.dfki.inquisition.lucene.RemoteIndexReader;
import de.dfki.inquisition.lucene.RemoteIndexSearcher;
import de.dfki.inquisition.lucene.RemoteMultiIndexReader;
import de.dfki.inquisition.lucene.RemoteMultiIndexSearcher;
import de.dfki.inquisition.lucene.Term2FrequencyEntry;
import de.dfki.inquisition.text.StringUtils;
......@@ -290,7 +288,7 @@ public class LuceneIndexSet implements Runnable, Serializable
ArrayList<String> alFieldTerms = new ArrayList<String>();
RemoteMultiIndexReader reader = IndexAccessor.getMultiIndexReader(getIndexPaths());
RemoteIndexReader reader = IndexAccessor.getMultiIndexReader(getIndexPaths());
List<Term2FrequencyEntry> lTerm2Freq = reader.terms(strFieldName, "", Integer.MAX_VALUE);
......@@ -322,7 +320,7 @@ public class LuceneIndexSet implements Runnable, Serializable
public List<Term2FrequencyEntry> getAllTermsWithPrefix(String strFieldName, String strPrefix, int iMaxTerms2Return) throws IOException, URISyntaxException
{
RemoteMultiIndexReader reader = IndexAccessor.getMultiIndexReader(getIndexPaths());
RemoteIndexReader reader = IndexAccessor.getMultiIndexReader(getIndexPaths());
List<Term2FrequencyEntry> lTerm2Freq = reader.terms(strFieldName, strPrefix, iMaxTerms2Return);
......@@ -377,7 +375,7 @@ public class LuceneIndexSet implements Runnable, Serializable
public MinMaxString getFieldMinMaxStringValues(String strFieldName) throws Exception
{
RemoteMultiIndexReader reader = IndexAccessor.getMultiIndexReader(getIndexPaths(), true);
RemoteIndexReader reader = IndexAccessor.getMultiIndexReader(getIndexPaths(), true);
String strAttributeType = m_attributeConfig.getAttributeType(strFieldName);
if(strAttributeType.equalsIgnoreCase(AttributeConfig.AttributeTypes.Date)) strAttributeType = AttributeConfig.AttributeTypes.Long;
......@@ -684,7 +682,7 @@ public class LuceneIndexSet implements Runnable, Serializable
{
if(bRefreshReader) IndexAccessor.refreshAllIndexReaders();
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(getIndexPaths());
TopDocs topDocs = searcher.search(new TermQuery(docID), 1);
......
......@@ -29,14 +29,13 @@ import org.dynaq.config.DynaQMessages;
import org.dynaq.core.DynaQDocument;
import org.dynaq.core.DynaQURINotFoundException;
import org.dynaq.util.images.ThumbNailer;
import org.dynaq.webservice.DynaQServer;
import org.kafkaRCP.core.RCPGlobalMessageListener;
import org.kafkaRCP.ui.KafkaRCP;
import de.dfki.inquisition.collections.CollectionUtilz;
import de.dfki.inquisition.exceptions.ExceptionUtils;
import de.dfki.inquisition.lucene.IndexAccessor;
import de.dfki.inquisition.lucene.RemoteMultiIndexSearcher;
import de.dfki.inquisition.lucene.RemoteIndexSearcher;
......@@ -101,7 +100,7 @@ public class PostProcessingRunnable implements Runnable, RCPGlobalMessageListene
{
final LinkedList<String> llUris = new LinkedList<String>();
final RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(luceneIndexSet.getIndexPaths());
final RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(luceneIndexSet.getIndexPaths());
BooleanQuery boolQuery = new BooleanQuery();
......
......@@ -3,6 +3,8 @@ package org.dynaq.project_specific.aloe;
import java.io.InputStream;
import java.util.Set;
import de.dfki.delight.common.HideValueLogs;
public interface AloeEventObserver
......@@ -111,7 +113,7 @@ public interface AloeEventObserver
public void notifyAloeEvent(String strEventType, String strJsonData, InputStream streamData, Set<String> hsIndexSets);
public void notifyAloeEvent(String strEventType, String strJsonData,@HideValueLogs InputStream streamData, Set<String> hsIndexSets);
......
......@@ -4,15 +4,13 @@ package org.dynaq.project_specific.aloe;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.Collections;
import java.util.logging.LogManager;
import org.dynaq.webservice.DynaQServerManager;
import org.kafkaRCP.core.KafkaRCPConstants;
import org.kafkaRCP.ui.KafkaRCP;
import de.dfki.inquisition.file.FileUtils;
import de.dfki.inquisition.net.DelightServerManager;
import de.dfki.inquisition.resources.ResourceUtilz;
......@@ -57,10 +55,7 @@ public class DynaQServerManager4Aloe
ResourceUtilz.copyResources2Disk("/dynaqWorkingDirContent", KafkaRCPConstants.addKafkaBaseDir2RelativePath("."), false);
KafkaRCP.copyReferenceConfigFiles(new File(KafkaRCPConstants.addKafkaBaseDir2RelativePath("./config")));
File fLogProps = new File(KafkaRCPConstants.addKafkaBaseDir2RelativePath("config/logging.properties"));
if(!fLogProps.exists()) FileUtils.copyFile(new File(fLogProps.getAbsolutePath() + ".reference"), fLogProps);
LogManager.getLogManager().readConfiguration(new FileInputStream(fLogProps));
System.setProperty("java.util.logging.config.file", fLogProps.getAbsolutePath());
DynaQServerManager.initializeLogging();
int iServerPort = -1;
......
......@@ -61,7 +61,7 @@ import de.dfki.inquisition.comparables.ComparableOrStringValueComparator;
import de.dfki.inquisition.exceptions.ExceptionUtils;
import de.dfki.inquisition.lucene.Buzzwords;
import de.dfki.inquisition.lucene.IndexAccessor;
import de.dfki.inquisition.lucene.RemoteMultiIndexSearcher;
import de.dfki.inquisition.lucene.RemoteIndexSearcher;
import de.dfki.inquisition.text.StringUtils;
......@@ -500,7 +500,7 @@ public class SimpleIndexInterface
IndexWriter writer = IndexAccessor.getIndexWriter(m_luceneIndexSet.getDefaultIndexPath(), LuceneIndexSet.getDynaQAnalyzer());
IndexAccessor.refreshIndexReader(m_luceneIndexSet.getDefaultIndexPath(), true);
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
try
{
......@@ -561,7 +561,7 @@ public class SimpleIndexInterface
if(m_luceneIndexSet.getDefaultIndexPath() != null && m_luceneIndexSet.getDefaultIndexPath().trim().length() != 0)
IndexAccessor.refreshIndexReader(m_luceneIndexSet.getDefaultIndexPath(), true);
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
Term idTerm = new Term(strIDAttName, strIDAttValue);
TopDocs topDocs = searcher.search(new TermQuery(idTerm), 1);
......@@ -608,7 +608,7 @@ public class SimpleIndexInterface
public List<String> getDocumentAttributeValues(String strUriAttributeName, String strDocUri, String strAttName) throws Exception
{
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
TopDocs topDocs = searcher.search(new TermQuery(new Term(strUriAttributeName, strDocUri)), 1);
......@@ -645,7 +645,7 @@ public class SimpleIndexInterface
if(m_luceneIndexSet.getDefaultIndexPath() != null && m_luceneIndexSet.getDefaultIndexPath().trim().length() != 0)
IndexAccessor.refreshIndexReader(m_luceneIndexSet.getDefaultIndexPath(), true);
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
BooleanQuery idQuery = new BooleanQuery();
......@@ -692,7 +692,7 @@ public class SimpleIndexInterface
if(m_luceneIndexSet.getDefaultIndexPath() != null && m_luceneIndexSet.getDefaultIndexPath().trim().length() != 0)
IndexAccessor.refreshIndexReader(m_luceneIndexSet.getDefaultIndexPath(), true);
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
Term idTerm = new Term(strIDAttName, strIDAttValue);
......@@ -759,7 +759,7 @@ public class SimpleIndexInterface
public Set<String> getMatchingQueryTerms(String queryString, List<String> atts4Search) throws Exception
{
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
DynaQQuery dynaqQuery = new DynaQQuery(queryString, null, 0, atts4Search, m_luceneIndexSet);
......@@ -972,7 +972,7 @@ public class SimpleIndexInterface
if(m_luceneIndexSet.getDefaultIndexPath() != null && m_luceneIndexSet.getDefaultIndexPath().trim().length() != 0)
IndexAccessor.refreshIndexReader(m_luceneIndexSet.getDefaultIndexPath(), true);
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
Term idTerm = new Term(strIDAttName, strIDAttValue);
TopDocs topDocs = searcher.search(new TermQuery(idTerm), 1);
......@@ -1531,7 +1531,7 @@ public class SimpleIndexInterface
DynaQResultList resultList = this.searchLocal(strUserQueryString, hsTerm2Boost, alContextDocUris, contextDocsWeight, lInitialSelectedAtts, -1, null, null);
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
LinkedList<ScoredDocument> llDocs = new LinkedList<ScoredDocument>();
......@@ -1602,7 +1602,7 @@ public class SimpleIndexInterface
bReverse);
RemoteMultiIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
RemoteIndexSearcher searcher = IndexAccessor.getMultiIndexSearcher(m_luceneIndexSet.getIndexPaths());
LinkedList<ScoredDocument> llDocs = new LinkedList<ScoredDocument>();
......
......@@ -47,6 +47,7 @@ import de.dfki.inquisition.collections.MultiValueHashMap;
import de.dfki.inquisition.lucene.Buzzwords;
import de.dfki.inquisition.lucene.IndexAccessor;
import de.dfki.inquisition.lucene.RemoteIndexReader;
import de.dfki.inquisition.lucene.RemoteIndexSearcher;
import de.dfki.inquisition.lucene.RemoteMultiIndexSearcher;
import de.dfki.inquisition.net.DelightServerManager;
......@@ -112,7 +113,7 @@ public class DynaQServer implements DynaQService, Runnable
protected HashMap<String, String> m_hsIndexSetID2IndexReaderUri = new HashMap<String, String>();
protected HashMap<String, RemoteMultiIndexSearcher> m_hsIndexSetID2IndexSearcherHandler = new HashMap<String, RemoteMultiIndexSearcher>();
protected HashMap<String, RemoteIndexSearcher> m_hsIndexSetID2IndexSearcherHandler = new HashMap<String, RemoteIndexSearcher>();
......@@ -210,8 +211,7 @@ public class DynaQServer implements DynaQService, Runnable
/**
* Creates a new DynaQServer Object, starting the service
*
* @param iServicePort the port under which the service should be started. If -1 some arbitrary free port will be used, with the chance to ofind this service over the
* bonjour/zeroConf protocoll. Smaller than -1 means that the service will NOT start. Use this to easily read out the server related config files.
* @param iServicePort the port under which the service should be started. If -1 the configured port number will be used. Smaller than -1 means that the service will NOT start. Use this to easily read out the server related config files.
* @param bOnlyLocalhost true if this interface should only be accessible from localhost
*
* @throws Exception
......@@ -595,7 +595,7 @@ public class DynaQServer implements DynaQService, Runnable
m_hsIndexSetID2IndexReaderHandler.put(indexSetId, readerHandler);
m_hsIndexSetID2IndexReaderUri.put(indexSetId, readerUri.toString());
RemoteMultiIndexSearcher indexSearcherHandler = IndexAccessor.getMultiIndexSearcher(luceneIndexSet.getIndexPaths());
RemoteIndexSearcher indexSearcherHandler = IndexAccessor.getMultiIndexSearcher(luceneIndexSet.getIndexPaths());
URI searcherUri = DelightServerManager.addHandler(m_servicePort, indexSearcherHandler, indexSetId + "_searcher", false);
m_hsIndexSetID2IndexSearcherHandler.put(indexSetId, indexSearcherHandler);
m_hsIndexSetID2IndexSearcherUri.put(indexSetId, searcherUri.toString());
......
......@@ -30,7 +30,7 @@ public class DynaQServerManager
{
protected static void initializeLogging() throws SecurityException, FileNotFoundException, IOException
public static void initializeLogging() throws SecurityException, FileNotFoundException, IOException
{
File fLogProps = new File(KafkaRCPConstants.addKafkaBaseDir2RelativePath("config/logging.properties"));
......
# Encoding is in UTF-8 !
#
# This file specifies how the import of (several) csv files into a lucene index should be proceed
#
########
#
# Configure your imports as follows:
#
# #the path to a csv file
# csvFile=<path2csv>
# [
#
# #CSV related parameters
# encoding=<e.g. UTF-8>
# delimiter=<for the columns, e.g. ';'>
# ignoreLeadingWhitespace=<cuts the whitespace at both the start and end of a cell value. 'true' or 'false'>
# commentstart=<ignore lines with starting comment char, e.g. '#'>
# encapsulator=<the char that encapsulates complex csv values, e.g. '"'>
# escapeCharacter=<the char that escapes encapsulators inside complex values, e.g. '"' or '\'>
#
#
# #target index, in the case you start the import as part of the dynaq indexing process, you can leave it out - then the default index of the running DynaQ instance will be used
# targetLuceneIndexPath=<the path to the target lucene index>
#
# sourceColumnIndex=<indicates a column that should be imported by its index, e.g. '0'>
# [
# targetAttributeName=<the name of the attribute target attribute of the index, e.g. 'urn:catwiesel:attribute:uri'. You can specify several target attributes for one csv column>
# # ....
# ]
# # ....
#
# sourceColumnName=<indicates a column that should be imported by its name, e.g. 'Title'. This assumes that the first line inside the csv specifies the column names>
# [
# targetAttributeName=<the target attribute name 1>
# targetAttributeName=<the target attribute name 2>
# # ....
# ]
# # ....
#
# # here you can specify some fix attribute-value-pairs that should be added into each index entry
# staticAttributeValues=
# {
# staticAttributeName1=staticAttributeValue1
# staticAttributeName2=staticAttributeValue2
# # ....
# }
# ]
#
#
####################################################
#
# NEEDED Attributes from DynaQ (make sure these are there, at least as static attribute-value pairs
#
# http://www.semanticdesktop.org/ontologies/2007/01/19/nie#dataSource
# urn:catwiesel:attribute/source_human_readable
# urn:catwiesel:attribute:uri
# #as static:
# urn:catwiesel:attribute:entry_type=document
......@@ -22,7 +22,7 @@ import de.dfki.inquisition.file.FileUtils;
public class FeldWaldWiese_special
public class PippiLangstrumpf
{
static
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment