Why not just search the 2 fields? q=*:*&fq=mediacode:AB OR id:123456
You could take the user input and replace it: q=*:*&fq=mediacode:$input OR id:$input Of course you can also use dismax and wrap with an OR. Bill Bell Sent from mobile On Jul 20, 2011, at 3:38 PM, Chris Hostetter <hossman_luc...@fucit.org> wrote: > > : Am 20.07.2011 19:23, schrieb Kyle Lee: > : > Is the mediacode always alphabetic, and is the ID always numeric? > : > > : No sadly not. We expose our products on "too" many medias :-). > > If i'm understanding you correctly, you're saying even the prefix "AB" is > not special, that there could be any number of prefixes identifying > differnet "mediacodes" ? and the product ids aren't all numeric? > > your question seems .... absurd. > > I can only assume that I am horribly missunderstanding your situation. > (which is very easy to do when you only have a single contrieved piece of > example data to go on) > > As a general rule, it's not a good idea to think about Solr in the same > way as a relational database, but Perhaps if you imagine for a moment that > your Solr index *was* a (read only) relational database, with each > solr field corrisponding to a column in your DB, and then you described in > psuedo-code/sql how you would go about doing the types of id lookups you > want to do, it might give us a better idea of your situation so we can > suggest an approach for dealing with it. > > > -Hoss