You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Paddy Kalathur <pa...@efoundry.com> on 2005/06/21 17:14:18 UTC

First time user Question

I want Lucene to search as well as sort data . What I am not sure is, how to
index my data so that I can sort and search.

For example :  I have a 3 rows in the database with name field value
"Geoffrey Rush" , "Will Smith", and "Eva Smith" . 

I want to index these names so that :
1.If a user searches for "Smith" I get "Will Smith" and "Eva Smith" . 
2.If a user searches for "Eva Smith" I get only "Eva Smith". 
3.When I list all the names available in my Index I sort them in alphabetic
order.
4.The searches should be case insensitive.       

How should I index the data so that I can achieve the above.   
   

Paddy Kalathur
eFoundry Corp
http://www.efoundry.com
978-371-3325


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


RE: First time user Question

Posted by Paddy Kalathur <pa...@efoundry.com>.
If I use Field.Keyword("name", "Will Smith") to index the name, will I be
able to search for it if a user searched for just "will" or "Smith" ?  I
think Field.Keyword does not tokenize and hence I should be able to sort it
also . 


-----Original Message-----
From: Otis Gospodnetic [mailto:otis_gospodnetic@yahoo.com] 
Sent: Tuesday, June 21, 2005 4:59 PM
To: java-user@lucene.apache.org
Subject: Re: First time user Question 

Hi Paddy,

Just make sure you index the sortable fields without tokenizing them.
c.f. http://www.lucenebook.com/search?query=index+for+sorting

Otis


--- Paddy Kalathur <pa...@efoundry.com> wrote:

> I want Lucene to search as well as sort data . What I am not sure is, 
> how to index my data so that I can sort and search.
> 
> For example :  I have a 3 rows in the database with name field value 
> "Geoffrey Rush" , "Will Smith", and "Eva Smith" .
> 
> I want to index these names so that :
> 1.If a user searches for "Smith" I get "Will Smith" and "Eva Smith" .
> 
> 2.If a user searches for "Eva Smith" I get only "Eva Smith". 
> 3.When I list all the names available in my Index I sort them in 
> alphabetic order.
> 4.The searches should be case insensitive.       
> 
> How should I index the data so that I can achieve the above.   
>    
> 
> Paddy Kalathur
> eFoundry Corp
> http://www.efoundry.com
> 978-371-3325



____________________________________________________________________
Simpy -- simpy.com -- tags, social bookmarks, personal search engine

---------------------------------------------------------------------
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


Re: First time user Question

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Hi Paddy,

Just make sure you index the sortable fields without tokenizing them.
c.f. http://www.lucenebook.com/search?query=index+for+sorting

Otis


--- Paddy Kalathur <pa...@efoundry.com> wrote:

> I want Lucene to search as well as sort data . What I am not sure is,
> how to
> index my data so that I can sort and search.
> 
> For example :  I have a 3 rows in the database with name field value
> "Geoffrey Rush" , "Will Smith", and "Eva Smith" . 
> 
> I want to index these names so that :
> 1.If a user searches for "Smith" I get "Will Smith" and "Eva Smith" .
> 
> 2.If a user searches for "Eva Smith" I get only "Eva Smith". 
> 3.When I list all the names available in my Index I sort them in
> alphabetic
> order.
> 4.The searches should be case insensitive.       
> 
> How should I index the data so that I can achieve the above.   
>    
> 
> Paddy Kalathur
> eFoundry Corp
> http://www.efoundry.com
> 978-371-3325



____________________________________________________________________
Simpy -- simpy.com -- tags, social bookmarks, personal search engine

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