Permalink
Browse files

Bumping the version of sensei to 1.5.38 and updating based on Dmytro'…

…s review
  • Loading branch information...
Dhruv Arya
Dhruv Arya committed Feb 5, 2014
1 parent b1ebc6e commit b095cc5b3f47efa23f97e5ac5e5dad75bd718b7c
@@ -20,13 +20,9 @@
package com.senseidb.test.client;
import java.util.Arrays;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
-import com.senseidb.search.client.CustomObjConstructor;
-import com.senseidb.search.client.req.query.QueryJsonHandler;
-import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.Assert;
import org.junit.Before;
@@ -54,7 +50,7 @@
private SenseiServiceProxy senseiServiceProxy;
@Before
public void setUp () {
- senseiServiceProxy = new SenseiServiceProxy("localhost", 9000);
+ senseiServiceProxy = new SenseiServiceProxy("localhost", 8080);
}
@Test
public void testSelectionRange() throws Exception
@@ -320,8 +316,6 @@ public void testSpanFirstQuery() throws Exception
assertEquals("numhits is wrong", 2160, res.getNumhits().intValue());
}
-
-
@Test
public void testUIDFilter() throws Exception
{
@@ -487,7 +481,6 @@ public void testMapReduce() throws Exception{
assertEquals("{\"min\":2100,\"uid\":4757}", res.getMapReduceResult().toString());
}
-
/* Need to fix the bug in bobo and kamikazi, for details see the following two test cases:*/
// public void testAndFilter1() throws Exception
View
@@ -1 +1 @@
-version=1.5.32
+version=1.5.38
View
@@ -6,7 +6,7 @@ log4j.appender.console1.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p
log4j.appender.sensei-query=org.apache.log4j.DailyRollingFileAppender
log4j.appender.sensei-query.encoding=UTF-8
-log4j.appender.sensei-query.File=/tmp/sensei-query.log
+log4j.appender.sensei-query.File=${log.home}/sensei-query.log
log4j.appender.sensei-query.DatePattern='.'yyyy-MM-dd
log4j.appender.sensei-query.layout=org.apache.log4j.PatternLayout
log4j.appender.sensei-query.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{1}] %m%n
@@ -15,7 +15,7 @@ log4j.appender.sensei-query.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS}
log4j.appender.sensei=org.apache.log4j.DailyRollingFileAppender
log4j.appender.sensei.encoding=UTF-8
-log4j.appender.sensei.File=/tmp/sensei-server.log
+log4j.appender.sensei.File=${log.home}/sensei-server.log
log4j.appender.sensei.DatePattern='.'yyyy-MM-dd
@@ -25,7 +25,7 @@ log4j.appender.sensei.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%
log4j.appender.sensei-zoie=org.apache.log4j.DailyRollingFileAppender
log4j.appender.sensei-zoie.encoding=UTF-8
-log4j.appender.sensei-zoie.File=/tmp/sensei-zoie.log
+log4j.appender.sensei-zoie.File=${log.home}/sensei-zoie.log
log4j.appender.sensei-zoie.DatePattern='.'yyyy-MM-dd
@@ -35,7 +35,7 @@ log4j.appender.sensei-zoie.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS}
log4j.appender.root=org.apache.log4j.DailyRollingFileAppender
log4j.appender.root.encoding=UTF-8
-log4j.appender.root.File=/tmp/sensei-main.log
+log4j.appender.root.File=${log.home}/sensei-main.log
log4j.appender.root.DatePattern='.'yyyy-MM-dd
@@ -45,7 +45,7 @@ log4j.appender.root.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS} %p [%c{
log4j.appender.sensei-bobo=org.apache.log4j.DailyRollingFileAppender
log4j.appender.sensei-bobo.encoding=UTF-8
-log4j.appender.sensei-bobo.File=/tmp/sensei-bobo.log
+log4j.appender.sensei-bobo.File=${log.home}/sensei-bobo.log
log4j.appender.sensei-bobo.DatePattern='.'yyyy-MM-dd
@@ -55,7 +55,7 @@ log4j.appender.sensei-bobo.layout.ConversionPattern=%d{yyyy/MM/dd HH:mm:ss.SSS}
log4j.appender.sensei-norbert=org.apache.log4j.DailyRollingFileAppender
log4j.appender.sensei-norbert.encoding=UTF-8
-log4j.appender.sensei-norbert.File=/tmp/sensei-norbert.log
+log4j.appender.sensei-norbert.File=${log.home}/sensei-norbert.log
log4j.appender.sensei-norbert.DatePattern='.'yyyy-MM-dd
@@ -112,16 +112,19 @@ private SenseiResult browse(SenseiRequest senseiRequest, MultiBoboBrowser browse
ScoreDoc[] scoreDocs = null;
float [][] features = null;
- if (collector != null) {
+ if (collector == null) {
+ res = browser.browse(req);
+ hits = res.getHits();
+ }
+ else {
Map<String, FacetAccessible> facetCollectors = new HashMap<String, FacetAccessible>();
Weight w = req.getQuery().createWeight(browser);
browser.browse(req, w, collector, facetCollectors, offset);
- //Map<String, FacetHandler<?>> facetHandlerMap = browser.getFacetHandlerMap();
- //browser.getFieldVal()
- //browser.getRawFieldVal()
-
try {
+ /**
+ * A custom collector must implement topDocs() method and a getHitsFeatures() method.
+ */
scoreDocs = (ScoreDoc[]) collector.getClass().getMethod(TOP_DOCS_METHOD).invoke(collector);
features = (float[][]) collector.getClass().getMethod(GET_HITS_FEATURES_METHOD).invoke(collector);
hits = new BrowseHit[scoreDocs.length];
@@ -152,15 +155,10 @@ private SenseiResult browse(SenseiRequest senseiRequest, MultiBoboBrowser browse
res.setNumHits(hits.length);
} catch (Exception e) {
- e.printStackTrace();
+ logger.error(e.getMessage(), e);
}
}
- else {
- res = browser.browse(req);
- hits = res.getHits();
- }
-
if (req.getMapReduceWrapper() != null) {
result.setMapReduceResult(req.getMapReduceWrapper().getResult());
@@ -320,7 +318,6 @@ public SenseiResult handlePartitionedRequest(final SenseiRequest request,
} catch (Exception e)
{
logger.error(e.getMessage(), e);
- e.printStackTrace();
throw e;
} finally
{
@@ -35,9 +35,6 @@
import junit.framework.TestCase;
import org.apache.log4j.Logger;
-import org.apache.lucene.analysis.Analyzer;
-import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.util.Version;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

0 comments on commit b095cc5

Please sign in to comment.