Solrを使用して単語の頻度を取得しようとしています。このクエリを実行すると:
localSolr/solr/select?q=someQuery&rows=0&facet=true&facet.field=content&wt=xml
solr は私に次のような周波数を与えます。
<lst name="facet_counts">
<lst name="facet_queries"/>
<lst name="facet_fields">
<lst name="content">
<int name="word1">24</int>
<int name="word2">12</int>
<int name="word3">8</int>
しかし、単語を数えると; word2 の実際のカウント数は 13 であることがわかりました。Solr は、フィールド内の同じ単語を 1 つとしてカウントします。
例えば;
フィールドのテキストは構成されています。word2 word5 word7 word9 word2
. Solr は word2 のカウント数 2 を返さず、代わりに 1 を返します。以下の両方の文の word2 のカウントとして 1 を返します。
word2 word10 word11 word12
word2 word9 word7 word2 word23
そのため、周波数が間違って返されます。ファセット フィールドを確認しましたが、適切なパラメーターが見つかりませんでした。文中の同じ単語をカウントするように修正するにはどうすればよいですか?
edit : schema.xml の関連部分:
<fieldType name="text_tr" class="solr.TextField" positionIncrementGap="100">
<field name="content" type="text_tr" stored="true" indexed="true" multiValued="true"/>
<copyField source="content" dest="text"/>
<field name="text" type="text_tr" stored="false" indexed="true" multiValued="true"/>