简体   繁体   English

Solr多值字段获取索引

[英]Solr multivalued field get index

I have two multivalued solr fields. 我有两个多值Solr字段。 Is it possible to get the index of one value in one field and use that index to get the value of another field. 是否有可能在一个字段中获取一个值的索引并使用该索引来获取另一字段的值。

For example: Field1: [A,B,C] Field2:[2010,2011,2012] 例如:Field1:[A,B,C] Field2:[2010,2011,2012]

I want to know what letter is in 2012. 我想知道2012年是什么字母。

yes, if you have those fields stored, then, you are guaranteed its values will be returned in the same order they were inserted. 是的,如果您存储了这些字段,那么可以保证其值将按照插入时的顺序返回。 So you can retrieve both fields, look at what position is 2012 in Field2, then look at that position in Field1. 因此,您可以检索两个字段,查看Field2在2012中的位置,然后查看Field1中的位置。

See here for a more detailed discussion. 请参阅此处进行更详细的讨论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM