Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

Lucene Question about Query

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


yogeshpateldaiict at gmail

May 6, 2012, 8:59 PM

Post #1 of 5 (310 views)
Permalink
Lucene Question about Query

Hi

I am using lucene for search implementation .
I have created index with two columns
(1) Name
(2) Year

I stored values like

AC 2001
AC 2002
ACC 2004
ACC 2001
ACJ 2006
ACJ 2007


I want to query in index to get year of AC ..When i query with Name:AC or
Name: "AC" , it gives me all record with ACC , ACJ etc..who start with
AC...But I need only records of AC..

So is it possible with lucene for exact query match?.

--
Yogesh Patel


fancyerii at gmail

May 6, 2012, 9:18 PM

Post #2 of 5 (301 views)
Permalink
Re: Lucene Question about Query [In reply to]

what's your analyzer?
if you use standard analyzer, I think this won't happen.
if you want to get exact match of name field, you should index this
field but not analyze it.

On Mon, May 7, 2012 at 11:59 AM, Yogesh patel
<yogeshpateldaiict [at] gmail> wrote:
> Hi
>
> I am using lucene for search implementation .
> I have created index with two columns
> (1) Name
> (2) Year
>
> I stored values like
>
> AC  2001
> AC  2002
> ACC 2004
> ACC 2001
> ACJ 2006
> ACJ 2007
>
>
> I want to query in index to get year of AC ..When i query with Name:AC or
> Name: "AC" , it gives me all record with ACC , ACJ etc..who start with
> AC...But I need only records of AC..
>
> So is it possible with lucene for exact query match?.
>
> --
> Yogesh Patel

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


yogeshpateldaiict at gmail

May 7, 2012, 11:25 PM

Post #3 of 5 (298 views)
Permalink
Re: Lucene Question about Query [In reply to]

I used SnowBall Analyzer with English language.In snowball analyzer is it
possible?


On Mon, May 7, 2012 at 9:48 AM, Li Li <fancyerii [at] gmail> wrote:

> what's your analyzer?
> if you use standard analyzer, I think this won't happen.
> if you want to get exact match of name field, you should index this
> field but not analyze it.
>
> On Mon, May 7, 2012 at 11:59 AM, Yogesh patel
> <yogeshpateldaiict [at] gmail> wrote:
> > Hi
> >
> > I am using lucene for search implementation .
> > I have created index with two columns
> > (1) Name
> > (2) Year
> >
> > I stored values like
> >
> > AC 2001
> > AC 2002
> > ACC 2004
> > ACC 2001
> > ACJ 2006
> > ACJ 2007
> >
> >
> > I want to query in index to get year of AC ..When i query with Name:AC or
> > Name: "AC" , it gives me all record with ACC , ACJ etc..who start with
> > AC...But I need only records of AC..
> >
> > So is it possible with lucene for exact query match?.
> >
> > --
> > Yogesh Patel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>
>


--
Yogesh Patel


ivan at brusic

May 8, 2012, 7:41 PM

Post #4 of 5 (299 views)
Permalink
Re: Lucene Question about Query [In reply to]

The snowball analyzer will not work since it analyzes the field. Use
the KeywordAnalyzer, which will preserve the text as is.

--
Ivan

On Mon, May 7, 2012 at 11:25 PM, Yogesh patel
<yogeshpateldaiict [at] gmail> wrote:
> I used SnowBall Analyzer with English language.In snowball analyzer is it
> possible?
>
>
> On Mon, May 7, 2012 at 9:48 AM, Li Li <fancyerii [at] gmail> wrote:
>
>> what's your analyzer?
>> if you use standard analyzer, I think this won't happen.
>> if you want to get exact match of name field, you should  index this
>> field but not analyze it.
>>
>> On Mon, May 7, 2012 at 11:59 AM, Yogesh patel
>> <yogeshpateldaiict [at] gmail> wrote:
>> > Hi
>> >
>> > I am using lucene for search implementation .
>> > I have created index with two columns
>> > (1) Name
>> > (2) Year
>> >
>> > I stored values like
>> >
>> > AC  2001
>> > AC  2002
>> > ACC 2004
>> > ACC 2001
>> > ACJ 2006
>> > ACJ 2007
>> >
>> >
>> > I want to query in index to get year of AC ..When i query with Name:AC or
>> > Name: "AC" , it gives me all record with ACC , ACJ etc..who start with
>> > AC...But I need only records of AC..
>> >
>> > So is it possible with lucene for exact query match?.
>> >
>> > --
>> > Yogesh Patel
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
>> For additional commands, e-mail: java-user-help [at] lucene
>>
>>
>
>
> --
> Yogesh Patel

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


yogeshpateldaiict at gmail

May 8, 2012, 9:33 PM

Post #5 of 5 (296 views)
Permalink
Re: Lucene Question about Query [In reply to]

Thanks so much..KeywordAnalyzer works fine with exact match...

On Wed, May 9, 2012 at 8:11 AM, Ivan Brusic <ivan [at] brusic> wrote:

> The snowball analyzer will not work since it analyzes the field. Use
> the KeywordAnalyzer, which will preserve the text as is.
>
> --
> Ivan
>
> On Mon, May 7, 2012 at 11:25 PM, Yogesh patel
> <yogeshpateldaiict [at] gmail> wrote:
> > I used SnowBall Analyzer with English language.In snowball analyzer is it
> > possible?
> >
> >
> > On Mon, May 7, 2012 at 9:48 AM, Li Li <fancyerii [at] gmail> wrote:
> >
> >> what's your analyzer?
> >> if you use standard analyzer, I think this won't happen.
> >> if you want to get exact match of name field, you should index this
> >> field but not analyze it.
> >>
> >> On Mon, May 7, 2012 at 11:59 AM, Yogesh patel
> >> <yogeshpateldaiict [at] gmail> wrote:
> >> > Hi
> >> >
> >> > I am using lucene for search implementation .
> >> > I have created index with two columns
> >> > (1) Name
> >> > (2) Year
> >> >
> >> > I stored values like
> >> >
> >> > AC 2001
> >> > AC 2002
> >> > ACC 2004
> >> > ACC 2001
> >> > ACJ 2006
> >> > ACJ 2007
> >> >
> >> >
> >> > I want to query in index to get year of AC ..When i query with
> Name:AC or
> >> > Name: "AC" , it gives me all record with ACC , ACJ etc..who start with
> >> > AC...But I need only records of AC..
> >> >
> >> > So is it possible with lucene for exact query match?.
> >> >
> >> > --
> >> > Yogesh Patel
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> >> For additional commands, e-mail: java-user-help [at] lucene
> >>
> >>
> >
> >
> > --
> > Yogesh Patel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>
>


--
Yogesh Patel
**
Jr. Software Engineer,
HighQSolutions

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.