質問

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>     

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 ?

役に立ちましたか?

解決

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"/>

The request would look like this

http:// localhost:8989/solr/analysis/field?wt=json&analysis.fieldvalue=test+dog+cat&analysis.fieldtype=tokenization_stopwords

For more information have a look in the javadoc of the FieldAnalysisRequestHandler

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top