Maria - thanks for detailed explanation. as per schema.xml; stored or indexed should be defined at schema design itself. as per my understanding defining at runtime is not feasible. BTW, you can have multiValued="true" attribute for dynamic fields too.
- Jeevanandam On Apr 29, 2012, at 1:06 AM, Vazquez, Maria (STM) wrote: > Thanks Jeevanandam. > That still doesn't have the same behavior as Lucene since multiple fields > with different names have to be created. > What I want is this exactly (multi-value field) > > document.add(new Field("geoids", geoId, Field.Store.YES, > Field.Index.NOT_ANALYZED_NO_NORMS)); > > document.add(new Field("geoids", geoId, Field.Store.NO, > Field.Index.NOT_ANALYZED_NO_NORMS)); > > In Lucene I can save geoids first as stored and in the next line as not > stored and it will do exactly that. I want to duplicate this behavior in Solr > but I can't do it having only one field in the schema called geoids that I an > manipulate at inde time whether to store or not depending on a condition. > > Thanks again for the help, hope this explanation makes it more clear in what > I'm trying to do. > > Maria > > On Apr 28, 2012, at 11:49 AM, "Jeevanandam" > <je...@myjeeva.com<mailto:je...@myjeeva.com>> wrote: > > Maria, > > For your need please define unique pattern using dynamic field in schema.xml > > Please have a look http://wiki.apache.org/solr/SchemaXml#Dynamic_fields > > Hope that helps! > > -Jeevanandam > > Technology keeps you connected! > > On Apr 28, 2012, at 10:33 PM, "Vazquez, Maria (STM)" > <maria.vazq...@dexone.com<mailto:maria.vazq...@dexone.com>> wrote: > > I can call a script for the logic part but what I want to figure out is how > to save the same field sometimes as stored and indexed, sometimes as stored > not indexed, etc. From a transformer or a script I didn't see anything where > I can modify that at indexing time. > Thanks a lot, > Maria > > > On Apr 27, 2012, at 18:38, "Bill Bell" > <billnb...@gmail.com<mailto:billnb...@gmail.com>> wrote: > > Yes you can. Just use a script that is called for each row. > > Bill Bell > Sent from mobile > > > On Apr 27, 2012, at 6:38 PM, "Vazquez, Maria (STM)" > <maria.vazq...@dexone.com<mailto:maria.vazq...@dexone.com>> wrote: > > Hi, > I'm migrating a project from Lucene 2.9 to Solr 3.4. > There is a special case in the code that indexes the same field in two > different ways, which is completely legal in Lucene directly but I don't know > how to duplicate this same behavior in Solr: > > if (isFirstGeo) { > document.add(new Field("geoids", geoId, Field.Store.YES, > Field.Index.NOT_ANALYZED_NO_NORMS)); > isFirstGeo = false; > } else { > if (countProducts < 100) > document.add(new Field("geoids", geoId, Field.Store.NO, > Field.Index.NOT_ANALYZED_NO_NORMS)); > else > document.add(new Field("geoids", geoId, Field.Store.YES, Field.Index.NO)); > } > > Is there any way to do this in Solr in a Tranformer? I'm using the DIH to > index and I can't see a way to do this other than having three fields in the > schema like geoids_store_index, geoids_nostore_index, and > geoids_store_noindex. > > Thanks a lot in advance. > Maria > > >