SolrHighlighter highligher = rb.req.getCore().getHighlighter(); if (highligher.isHighlightingEnabled(rb.req.getParams()))
@Override public SolrCore getCore() { return request.getCore(); }
@Override public SolrCore getCore() { return request.getCore(); }
public RunUpdateProcessor(SolrQueryRequest req, UpdateRequestProcessor next) { super( next ); this.req = req; this.updateHandler = req.getCore().getUpdateHandler(); }
/** * Returns the {@link SolrRequestHandler} associated with the given name. * * @param request the current Solr request. * @param name the {@link SolrRequestHandler} name. * @return the {@link SolrRequestHandler} associated with the given name. */ SolrRequestHandler requestHandler(final SolrQueryRequest request, final String name) { return request.getCore().getRequestHandler(name); }
protected QueryResponseWriter getBaseWriter( SolrQueryRequest request ) { return request.getCore().getQueryResponseWriter( _baseWriter ); }
protected void execute( HttpServletRequest req, SolrRequestHandler handler, SolrQueryRequest sreq, SolrQueryResponse rsp) { // a custom filter could add more stuff to the request before passing it on. // for example: sreq.getContext().put( "HttpServletRequest", req ); // used for logging query stats in SolrCore.execute() sreq.getContext().put( "webapp", req.getContextPath() ); sreq.getCore().execute( handler, sreq, rsp ); }
@Override public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { // this may or may not have the core SolrCore core = req.getCore(); SecureRequestHandlerUtil.checkSentryAdmin(req, SecureRequestHandlerUtil.QUERY_ONLY, getClass().getName(), core != null, null); super.handleRequestBody(req, rsp); } }
public FileFloatSource(SchemaField field, SchemaField keyField, float defVal, QParser parser) { this.field = field; this.keyField = keyField; this.defVal = defVal; this.dataDir = parser.getReq().getCore().getDataDir(); }
@Override public void prepare(ResponseBuilder rb) throws IOException { SolrHighlighter highlighter = rb.req.getCore().getHighlighter(); rb.doHighlights = highlighter.isHighlightingEnabled(rb.req.getParams()); }
/** * Creates a new instance. * * @param req the solr request * @param rsp the solr response */ public SolrUpdateService(SolrQueryRequest req, SolrQueryResponse rsp) { this(req, req.getCore() .getUpdateProcessorChain(req.getParams()) .createProcessor(req, rsp)); }
/** * {@inheritDoc} */ protected NamedList doAnalysis(SolrQueryRequest req) throws Exception { FieldAnalysisRequest analysisRequest = resolveAnalysisRequest(req); IndexSchema indexSchema = req.getCore().getSchema(); return handleAnalysisRequest(analysisRequest, indexSchema); }
@Override public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { String collection = null; if (req.getCore() == null) { // if the request doesn't have a core, let's use the core stored on the // request handler collection = core.getCoreDescriptor().getCloudDescriptor().getCollectionName(); } SecureRequestHandlerUtil.checkSentryAdmin(req, SecureRequestHandlerUtil.QUERY_AND_UPDATE, getClass().getName(), true, collection); super.handleRequestBody(req, rsp); } }
@Override public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) { if (luceneMatchVersion == null) { this.luceneMatchVersion = req.getCore().getSolrConfig().luceneMatchVersion; parseConfig(); } return new SynonymExpandingExtendedDismaxQParser(qstr, localParams, params, req, synonymAnalyzers); }
public SirenQParser(final String qstr, final SolrParams localParams, final SolrParams params, final SolrQueryRequest req) { super(qstr, localParams, params, req); // change the BooleanQuery maxClauseCount for ALL cores ... // Since QParserPlugin cannot be SolrCoreAware, we cannot do this at plugin init time int maxClauseCount = req.getCore().getSolrConfig().booleanQueryMaxClauseCount; NodeBooleanQuery.setMaxClauseCount(maxClauseCount); TwigQuery.setMaxClauseCount(maxClauseCount); }
@Override public void handleRequestBody(SolrQueryRequest solrQueryRequest, SolrQueryResponse solrQueryResponse) throws Exception { // delegate to the base class to check the status of this local index super.handleRequestBody(solrQueryRequest, solrQueryResponse); // if ping status is OK, then check cluster state of this core if ("OK".equals(solrQueryResponse.getValues().get("status"))) { verifyThisReplicaIsActive(solrQueryRequest.getCore()); } }
@Override public Query parse() throws SyntaxError { if (qstr == null || qstr.length()==0) return null; String defaultField = getParam(CommonParams.DF); if (defaultField==null) { defaultField = getReq().getSchema().getDefaultSearchFieldName(); } xmlParser = new XmlQueryParser(defaultField, new StandardAnalyzer(req.getCore().getSolrConfig().luceneMatchVersion)); try { return xmlParser.parse(new ByteArrayInputStream(qstr.getBytes(Charset.forName("utf-8")))); } catch (ParserException e) { throw new SyntaxError (e); } }
/** * Gets the processor build from the processor update chain(UpdateParams.UPDATE_CHAIN) * * @param req - the solr query request information * @param rsp - the solr query response information * @return the update request processor */ private UpdateRequestProcessor getProcessor(SolrQueryRequest req, SolrQueryResponse rsp) { UpdateRequestProcessorChain processorChain = req.getCore().getUpdateProcessingChain(req.getParams().get(UpdateParams.UPDATE_CHAIN)); return processorChain.createProcessor(req, rsp); }
@Override public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { SolrParams params = req.getParams(); boolean stats = params.getBool( "stats", false ); rsp.add( "plugins", getSolrInfoBeans( req.getCore(), stats ) ); rsp.setHttpCaching(false); }
@Override public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { rsp.add( "core", getCoreInfo( req.getCore() ) ); rsp.add( "lucene", getLuceneInfo() ); rsp.add( "jvm", getJvmInfo() ); rsp.add( "system", getSystemInfo() ); rsp.setHttpCaching(false); }