Index Metadata in a Numeric Field

70 Views Asked by At

I was trying to index some metadata in a numeric field of lucene.net but I don’t know how to do it. I built a class to find measures on descriptions, that class returns a list of measures in these form: “150{inch} 200{mm}” etc. And I want to index these values to search for them simultaneously, numeric value and the measure unit. How can I do that? I need to create a custom field?

Thank you.

1

There are 1 best solutions below

0
On

A couple of ideas (from the Lucene.Net mailing list)

  • Store all units of measure converted to a common unit. If user input is feet, or meters, or inches, convert that to your common unit and then search
  • Store a separate field for the unit type and the measure. Then you can do a search like unit:mm AND measure:100 or unit:feet AND measure:[4 to 7]