とハッシュの配列が、私はインデックスに次のようなデータ構造を持っている特許カタログを必要とする方法:インデックスにSolrの
"cpc": [
{
"class": "61",
"section": "A",
"sequence": "1",
"subclass": "K",
"subgroup": "06",
"main-group": "45",
"classification-value": "I"
},
{
"class": "61",
"section": "A",
"sequence": "2",
"subclass": "K",
"subgroup": "506",
"main-group": "31",
"classification-value": "I"
}
]
私は正しいアプローチはここにあると思いまして。私はcpc.classを使用し、それをmultiValued = "true"と組み合わせることができるかもしれません。
特定のCPCコードと一致するドキュメントを探したいと思います。 CPCコードは部分的にすることができます。今私の解決策は単にmultiValued = trueでネストされた参照を使用しています。これを行うより良い方法はありますか?
<field name="cpc.class" type="int" indexed="true" stored="true" multiValued="true" />
<field name="cpc.section" type="string" indexed="true" stored="true" multiValued="true" />
<field name="cpc.sequence" type="int" indexed="true" stored="true" multiValued="true" />
<field name="cpc.subclass" type="string" indexed="true" stored="true" multiValued="true" />
<field name="cpc.subgroup" type="int" indexed="true" stored="true" multiValued="true" />
<field name="cpc.main-group" type="int" indexed="true" stored="true" multiValued="true" />
<field name="cpc.classification-value" type="string" indexed="true" stored="true" multiValued="true" />
この実装の問題は、実際に検索条件に一致しないドキュメントを返すことです。例:
"cpc.section:A",
"cpc.class:61",
"cpc.subclass:Q",
"cpc.main-group:8"
この組み合わせがないドキュメントを取得します。現在の方法では、すべてのフィールドがリストであり、任意の組み合わせの一致する値が返されるように検索が実装されていると思います。私はそれを絞り込む必要がありますので、正しい組み合わせだけが返されます。
あなたは何を探したいですか?元のデータ構造ではなく、Solrの索引を検索するように構成します。 –
CPCは階層コードですか?特許インデックスをモデル化する場合は、[階層ファセット](https://www.google.de/search?q=solr+hierarchical+facets)を検討してください。 – cheffe
[子要素を持つSolr文書の可能な複製](http://stackoverflow.com/questions/5584857/solr-documents-with-child-elements) –