I did a similar thing at Kaango.com (classified system). The idea that I
used was to use dynamic fields based on type, and load them into SOLR.

For example,

Autos:
s_auto_make - String
s_auto_model - String
l_auto_year - Long

Real Estate:
l_real_estate_bedrooms - Long
l_read_estate_baths - Long

You get the idea. I created these by using the DIH handler and adding a
script at the top of the file that would take the field from the database,
and rename it based on what is was. Then I would load it into SOLR as a
dynamic field.

Then for the facets, I would configure the name of the dynamic fields that
need to be pulled (with facet.field or query).

For ranges: facet.query=l_years_of_service:[1999 TO 2004] or [1999 TO *]

That is how I solved a similar problem (if I understand the issue).

Bill


From:  mike anderson <[email protected]>
Reply-To:  <[email protected]>
Date:  Tue, 15 Feb 2011 10:51:43 -0500
To:  <[email protected]>
Cc:  <[email protected]>
Subject:  Fwd: Any contribs available for Range field type?




---------- Forwarded message ----------
From: kenf_nc <[email protected]>
Date: Fri, Feb 11, 2011 at 8:49 AM
Subject: Any contribs available for Range field type?
To: [email protected]



I have a huge need for a new field type. It would be a Poly field, similar
to
Point or Payload. It would take 2 data elements and a search would return a
hit if the search term fell within the range of the elements. For example
let's say I have a document representing an Employment record. I may want
to
create a field for years_of_service where it would take values 1999,2004.
Then in a query q=years_of_service:2001 would be a hit,
q=years_of_service:2010 would not. The field would need to take a data type
attribute as a parameter. I may need to do integer ranges, float/double
ranges, date ranges. I don't see the need now, but heck maybe even a string
range. This would be useful for things like Event dates. An event often
occurs between several days (or hours) but the query is something like
"what
events are happening today". If I did q=event_date:NOW (or similar) it
should hit all documents where event_date has a range that in inclusive of
today. Another example would be product category document. A specific
automobile may have a fixed price, but a category of auto (2010 BMW
3-series
for example) would have a price range.

I hope you get the point. My question (finally) is, does anyone know of an
existing contribution to the public domain that already does this? I'm more
of a .Net/C# developer than a Java developer. I know my way around Java,
but
don't really have the right tools to build/test/etc. So was hoping to
borrow
rather than build if I could.

Thanks,
Ken
--
View this message in context:
http://lucene.472066.n3.nabble.com/Any-contribs-available-for-Range-field-t
ype-tp2473601p2473601.html

Sent from the Solr - User mailing list archive at Nabble.com.





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to