Hi,

I've inherited an Solr application with a Schema that contains parent-child
relationship.  All child elements are maintained in multi-value fields.
So an Order with 3 Order lines will result in an array of size 3 in Solr,

This worked fine as long as clients queried only on Order, but with new
requirements it is serving inaccurate results.

Consider some orders, for example -


 {
OrderId:123
BookingRecordId : ["145", "987", "*234*"]
OrderLineType : ["11", "12", "*13*"]
.....
}
 {
OrderId:345
BookingRecordId : ["945", "882", "*234*"]
OrderLineType : ["1", "12", "*11*"]
.....
}
 {
OrderId:678
BookingRecordId : ["444"]
OrderLineType : ["11"]
.....
}


If you look up for an Order with BookingRecordId: 234 And OrderLineType:11.
 You will get two orders : 123 and 345, which is correct per Solr.   You
have two arrays in both the orders that satisfy this condition.

However, for OrderId:123, the value at 3rd index of OrderLineType array is
13 and not 11( this is for BookingRecordId:145) this should be excluded.

Per this blog :
http://blog.griddynamics.com/2011/06/solr-experience-search-parent-child.html

I can't use span queries as I have tons of child elements to query and I
want to keep any changes to client queries to minimum.

So is creating multiple indexes is the only way? We have 3 Physical boxes
with SolrCloud and at some point we would like to shard.

Appreciate any inputs.


Best,

-Vijay

Reply via email to