lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <jack.krupan...@lucidimagination.com>
Subject Re: Performing a query on token length
Date Fri, 21 Jan 2011 15:30:43 GMT
Oops... I only solved half the problem, the other half was to limit length 
to 20, which would be done with a negated leading wildcard of 21 question 
marks:

first_name:??????????* -first_name:?????????????????????*

-- Jack Krupansky

-----Original Message----- 
From: Jack Krupansky
Sent: Friday, January 21, 2011 10:26 AM
To: java-user@lucene.apache.org
Subject: Re: Performing a query on token length

A wildcard query with 10 leading question marks, each of which requires a
single character. This would also depend on leading wildcards being enabled
in your query parser (if you are using one.)

first_name:??????????*

The performance would not necessarily be great, but functionally it would do
exactly what you asked.

-- Jack Krupansky

-----Original Message----- 
From: Camden Daily
Sent: Friday, January 21, 2011 10:15 AM
To: java-user@lucene.apache.org
Subject: Performing a query on token length

Hello all,

Does anyone know if it is possible in Lucene to do a query based on the
string length of the value of a field?

For example, if I wanted all index matches where a specific field like
'first_name' was between 10 and 20 characters.

Thanks!
-Camden Daily


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message