Depends on whether the transformation is before or after the doc gets sent to Solr. If you're changing the data before you give it to Solr, then you'd have to have two fields, probably indexed=true and stored=false for the one you search on, and indexed=false stored=true for the one you return to the user.
This really doesn't take any more resources than using one field..... If you put some sort of (perhaps custom) filter in place, then the original value would go in as stored and the altered value would get in the index and you could do both in the same field. Best Erick On Sat, Dec 8, 2012 at 2:34 PM, jefferyyuan <yuanyun...@gmail.com> wrote: > Hi: > > I am wondering whether there is a way to round data when index, but still > able to return original content? > > For example, for a date field: 2012-12-21T12:12:12Z, because when search, > user only cares date part, so I can round it to 2012-12-12T00:00:00Z, when > index it - this can reduce index size, as there will be less term. > > But user still wants to get the original content, so the result of matched > doc will return 2012-12-21T12:12:12Z not 2012-12-12T00:00:00Z. > > This also applies to number and text field. > > Is there a way to do this in Solr? > > Thanks for you reply :) > > > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Is-there-a-way-to-round-data-when-index-but-still-able-to-return-original-content-tp4025405.html > Sent from the Solr - User mailing list archive at Nabble.com. >