Java 如何获取hybris facet search使用的solrclient、solr endpointurl和索引?

Java 如何获取hybris facet search使用的solrclient、solr endpointurl和索引?,java,solr,hybris,faceted-search,Java,Solr,Hybris,Faceted Search,我有我的SAP Hybris JAVA项目。它使用solr缓存产品和其他数据。 我想用指定的字符串和字符串的相关积从solr中搜索数据。 我是通过使用hybris分面搜索类实现的。但它的速度很慢。 所以我自己创建了我的HttpSorlClient和表单查询,它占用的时间非常少 final String urlString = "https://localhost:8983/solr/indexName"; final HttpSolrClient httpSolrClient = new Htt

我有我的SAP Hybris JAVA项目。它使用solr缓存产品和其他数据。 我想用指定的字符串和字符串的相关积从solr中搜索数据。 我是通过使用hybris分面搜索类实现的。但它的速度很慢。 所以我自己创建了我的HttpSorlClient和表单查询,它占用的时间非常少

final String urlString = "https://localhost:8983/solr/indexName";
final HttpSolrClient httpSolrClient = new HttpSolrClient.Builder(urlString).build();
final SolrQuery solrQuery = new SolrQuery();

final StringBuffer queryString = new StringBuffer();
        final String[] terms = searchtext.split(" ");
        IntStream.range(0, terms.length).forEach(idx -> {
            queryString.append("((code_string:");
            queryString.append(terms[idx] + "~) OR ");

            if (idx < terms.length - 1)
            {
                queryString.append(" OR ");
            }
        });

        solrQuery.set("q", queryString.toString());
        solrQuery.setFields("name_text_en");
        solrQuery.setRows(10000);

        final QueryRequest queryRequest = new QueryRequest(solrQuery);
            queryRequest.setBasicAuthCredentials("solrserver", "server123");
            final QueryResponse solrResponse = queryRequest.process(httpSolrClient);
            final SolrDocumentList documentList = solrResponse.getResults();
最终字符串urlString=”https://localhost:8983/solr/indexName";
final-HttpSolrClient-HttpSolrClient=new-HttpSolrClient.Builder(urlString.build();
final SolrQuery SolrQuery=new SolrQuery();
final StringBuffer queryString=新StringBuffer();
最终字符串[]terms=searchtext.split(“”);
IntStream.range(0,terms.length).forEach(idx->{
追加(((代码字符串:);
追加(术语[idx]+“~”或“);
if(idx

这里我想要我的urlString,它是由Hybris facet Search使用的。如果有人对此有想法,请提出建议。

所以你想使用Solr Server作为外部系统并与服务器-客户端方法集成。你不想使用OOTB facet Search服务,对吗?是的,我想执行我自己创建的查询。就像这样final QueryRequest QueryRequest=新QueryRequest(solrQuery);QueryResponse solrrresponse=QueryRequest.process(httpSolrClient);我不确定您面临的问题是什么?您是否无法发送请求?无法生成查询?或者无法处理响应?hello@ZaheerAttar感谢您的回复。上面的代码工作正常,但我想使用hybris faceted search类。我现在已经解决了它。感谢您的回复。所以您想使用Solr Server作为外部服务器nal系统并与服务器-客户端方法集成。您不想使用OOTB方面搜索服务,对吗?是的,我想执行自己创建的查询。例如,最终的QueryRequest QueryRequest=new QueryRequest(solrQuery);QueryResponse solrResponse=QueryRequest.process(httpSolrClient);我不确定您面临的问题是什么?您是否无法发送请求?无法生成查询?或者无法处理响应?hello@ZaheerAttar感谢您的回复。上面的代码工作正常,但我想使用hybris faceted search类。我现在已经解决了。感谢您的回复。