manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1758583 - /manifoldcf/integration/elasticsearch-2.0/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizerRestSearchAction.java
Date Wed, 31 Aug 2016 11:15:42 GMT
Author: kwright
Date: Wed Aug 31 11:15:42 2016
New Revision: 1758583

URL: http://svn.apache.org/viewvc?rev=1758583&view=rev
Log:
Bring in some code from master.

Modified:
    manifoldcf/integration/elasticsearch-2.0/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizerRestSearchAction.java

Modified: manifoldcf/integration/elasticsearch-2.0/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizerRestSearchAction.java
URL: http://svn.apache.org/viewvc/manifoldcf/integration/elasticsearch-2.0/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizerRestSearchAction.java?rev=1758583&r1=1758582&r2=1758583&view=diff
==============================================================================
--- manifoldcf/integration/elasticsearch-2.0/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizerRestSearchAction.java
(original)
+++ manifoldcf/integration/elasticsearch-2.0/trunk/src/main/java/org/apache/manifoldcf/elasticsearch/MCFAuthorizerRestSearchAction.java
Wed Aug 31 11:15:42 2016
@@ -31,7 +31,6 @@ import com.fasterxml.jackson.databind.Ob
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import org.elasticsearch.action.support.IndicesOptions;
 import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.unit.TimeValue;
 import org.elasticsearch.index.query.*;
 import org.elasticsearch.rest.RestRequest;
 import org.elasticsearch.rest.action.support.RestActions;
@@ -41,6 +40,7 @@ import org.elasticsearch.search.fetch.so
 import org.elasticsearch.search.sort.SortOrder;
 import org.elasticsearch.search.suggest.SuggestBuilders;
 import org.elasticsearch.search.suggest.term.TermSuggestionBuilder;
+import org.elasticsearch.common.unit.TimeValue;
 
 import java.io.*;
 
@@ -93,17 +93,20 @@ public class MCFAuthorizerRestSearchActi
             searchRequest.source(modifiedJSON.toString());
           }
         } catch (IOException e) {
-            e.printStackTrace();
-            throw new MCFAuthorizerException("JSON parser error");
+            throw new MCFAuthorizerException("JSON parser error: "+e.getMessage(),e);
           }
       }
 
+      //parseSearchSource(searchRequest.source(), request);
       searchRequest.extraSource(parseSearchSourceMCF(request));
       searchRequest.searchType(request.param("search_type"));
-      //TODO: figure out if we still need this??? searchRequest.queryCache(request.paramAsBoolean("query_cache",
(Boolean)null));
+      
+      // Should this be done?
+      searchRequest.requestCache(request.paramAsBoolean("request_cache", null));
+
       String scroll = request.param("scroll");
-      if(scroll != null) {
-        //TODO: figure out if we still need this??? searchRequest.scroll(new Scroll(TimeValue.parseTimeValue(scroll,
(TimeValue)null)));
+      if (scroll != null) {
+        searchRequest.scroll(new Scroll(TimeValue.parseTimeValue(scroll, null, "scroll")));
       }
 
       searchRequest.types(Strings.splitStringByCommaToArray(request.param("type")));



Mime
View raw message