multiValued has nothing to do with how many tokens are in the field, it's just whether you can call document.add("field1", val1) more than once on the same field. Or, equivalently, in input document in XML has two <field> entries with the same name="field" entries. So it strictly depends upon whether you want to take it upon yourself to make these long strings or call document.add once for each value in the field.
The field is returned as an array if it's multiValued.... Just to make your life interesting.... If you define your increment gap as 0, there is no difference between how multiValued fields are searched as opposed to single-valued fields. FWIW Erick On Tue, Nov 1, 2011 at 1:26 PM, Travis Low <t...@4centurion.com> wrote: > Greetings. We're finally kicking off our little Solr project. We're > indexing a paltry 25,000 records but each has MANY documents attached, so > we're using Tika to parse those documents into a big long string, which we > use in a call to solrj.addField("relateddoccontents", > bigLongStringOfDocumentContents). We don't care about search results > pointing back to a particular document, just one of the 25K records, so > this should work. > > Now my question. Many of these records have related records in other > tables, and there are several types of these related records. For example, > we have record #100 that my have blue records with numbers 1111, 2222, > 3333, and 4444, and red records with numbers 5555, 6666, 7777, 8888. > Currently we're just handling these the same way as related document > contents -- we concatenate them, separated by spaces, into one long string, > then we do solrj.addField("redRecords", stringOfRedRecordNumbers). That > is, stringOfRedRecordNumbers is "1111 2222 3333 4444". > > We have no need to show these records to the user in Solr search results, > because we're going to use the database for displaying of detailed > information for any records found. Is there any reason to specify > redRecords and blueRecords as multivalued fields in schema.xml? And if we > did that, we'd call solrj.addField() once for each value, would we not? > > cheers, > > Travis >