Hi Aditi, As Rohit said, the best way to solve this problem is to have two fields for indexing an email-id, one for the username and another for domain name.
Having two fields and using a Boolean Query with MUST condition should solve your problem. You can also perform restricted search with the above architecture, like search for user "x" with in the domain "gmail.com" --Sai Krishna. On Mon, Jun 23, 2008 at 2:37 PM, rohit saini <[EMAIL PROTECTED]> wrote: > Hi aditi, > > U can have a field corresponding to this domain....It will solve ur > problem...... > > bye > > Rohit > Impetus technologies- noida > mob. 09910220475 > > > On 6/23/08, Aditi Goyal <[EMAIL PROTECTED]> wrote: > > > > Hi All, > > > > I am using Lucene for creating indexes. There is one field as "email" > which > > stored the email id. > > I have few queries regarding searching: > > 1. I want to search for all the records having domain as "gmail.com" . > So, > > is there a way by which I can do a partial search on "email" field such > > that > > I get the records matching only the domain name. > > I think wildcard (*) cannot be used in the beginning :( > > > > 2. If I just want to search for the records which are not matching email > as > > "[EMAIL PROTECTED]" > > How can I search for it. Here, MUST_NOT cannot be used alone. Is there a > > way > > out? > > > > > > Please help. > > > > Thanks, > > Aditi > > > > > > -- > VANDE - MATRAM >