在SolR中以JSON格式获取分析结果 [英] Get the result of an analysis as a JSON in SolR
问题描述
我在SolR中做了如下过滤:
I made a filter in SolR as following :
<fieldtype name="tokenization_stopwords" class="solr.TextField" positionIncrementGap="100">
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
</analyzer>
</fieldtype>
在分析"部分中使用此过滤器时,它可以工作.但是,我希望能够 以获得此分析的结果作为JSON. 有谁知道该怎么做?
When I'm using this filter in the "Analysis" section, it works. However, I'd like to be able to get the result of this analysis as a JSON. Does anyone knows how to do this ?
推荐答案
为了获取该信息,您需要在solrconfig.xml中配置FieldAnalysisRequestHandler
并向他提问.
In order to get that you need to configure the FieldAnalysisRequestHandler
in your solrconfig.xml and ask him questions.
<requestHandler name="/analysis/field" class="solr.FieldAnalysisRequestHandler"/>
请求看起来像这样
http://localhost:8989/solr/analysis/field?wt = json& analysis.fieldvalue = test + dog + cat& analysis.fieldtype = tokenization_stopwords
http:// localhost:8989/solr/analysis/field?wt=json&analysis.fieldvalue=test+dog+cat&analysis.fieldtype=tokenization_stopwords
有关更多信息,请查看在FieldAnalysisRequestHandler的javadoc中
For more information have a look in the javadoc of the FieldAnalysisRequestHandler
这篇关于在SolR中以JSON格式获取分析结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!