tags:

views:

177

answers:

2

I'm trying to search for results within a range e.g. A TO C. However the results are coming in with results that contain letters within the range but I only want results that START with letters within the range.

A: 

Easiest way -- During index time, create another field that contains only the first letter. So if the field currently contains:

Alpha
Beta
Charlie

then index this in a separate field (non-analyzed):

A
B
C

Then use range query as usual

myFieldFirstLetter:[A TO C]
bajafresh4life
A: 

I ended up using frange provided by the QParser plugin available for solr 1.4

{!frange l=A u=C}fieldname

I got the info from here

Akeem