cancel
Showing results for 
Search instead for 
Did you mean: 

Lucene and Advanced Search

netos
Champ in-the-making
Champ in-the-making
hi all.

i have changed the advanced search screen so that i can search for some custom properties of mine in a range search (i.e. from x to y).

i thought it worked fine, i used the same addRangeAttribute method similiar to what is done with dates. the problem is that i found out that lucene searches the property lexicographically and as a result 20 becomes bigger than 108 for example…

does it help if i change the custom property from text to int or long? do i have to go through the entire DB and change the representation there also? can i just tell lucene i am referring to numbers? any idea?

help…

thx, netanel
2 REPLIES 2

ebo
Champ in-the-making
Champ in-the-making
I haven't used the "advanced search" screen and may be off tpoic but thought I'd have a go cause this forum can take a while to get an answer.

I have been using the Lucene proximity search to solve some problems but the following URL give you the full capability of the Lucene syntax.

http://lucene.apache.org/java/docs/queryparsersyntax.html#Proximity%20Searches

andy
Champ on-the-rise
Champ on-the-rise
Hi

Numbers are only treated correctly for numeric types, not text.

Andy