I have to ask "why can't you just store the second type with the same field names?" Or do they also have fields A, B and C?
It's possible to store these in separate _collections_, configured as you see fit and use "collection aliasing" to search them both with a single query, but that won't solve the naming problem. Otherwise, your idea of copying them to a common field is probably best, Best, Erick On Wed, Jun 27, 2018 at 12:04 PM, Grimes, Kevin M (398F) <kevin.m.gri...@jpl.nasa.gov> wrote: > Hi all, > > I have a unique situation that I’m not quite sure how to approach. > > In my current Solr collection, I have documents that look like this: > > { > “fieldA”: 1, > “fieldB”: 2, > “fieldC”: 3 > } > > We’re adding a new “type” of document, that looks like this: > > { > “fieldD”: 1, > “fieldE”: 2, > “fieldF”: 3 > } > > The issue is, “fieldA” and “fieldD”, although they have different names, > store the same sorts of values. In this example, the same is true for B & E, > C & F. > > I want to be able to search, for example, like this: “q=fieldA:1” and have it > return both the first document and the second one, too, since fields A & D > are equivalent, and they both store 1. However, I would also like to have a > query for “q=fieldD:1” return the same response. > > Is the best approach to solving this kind of problem to have a third field, > for example, “fieldG”, and have “fieldA” and “fieldD” copy it? Or is there a > cleaner solution? > > Thanks, > Kevin Grimes > 398F – Data Product Generation Software > o: 818-354-0263 c: 818-940-4727 > kevin.m.gri...@jpl.nasa.gov<mailto:kevin.m.gri...@jpl.nasa.gov> >