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 Yogesh patel <yo...@gmail.com> on 2012/04/15 09:44:57 UTC
Need help About Lucene Query
Hi,
I have read apache lucene tutorial and implemented in our project.But I
need help about my lucene question.
I have one Index which has two fields. A and B
Some values are like below
A B
_______________
AC 10
AC 20
ACC 30
ACC 40
ACP 70
I need lucene query to get results for only AC ..
I fired query like 'A:AC' it gives me result all start with AC
But i need exact match of query.
Please help me out
Awaiting for your positive reply.
Thanks
--
Yogesh Patel
Re: Need help About Lucene Query
Posted by Adriano Crestani <ad...@gmail.com>.
Hi Yogesh,
I bet you are indexing A as an analyzed field and its values are getting
tokenized at each capital letter it finds. Try to index field A using
Field.Index.NOT_ANALYZED.
On Sun, Apr 15, 2012 at 3:44 AM, Yogesh patel
<yo...@gmail.com>wrote:
> Hi,
>
> I have read apache lucene tutorial and implemented in our project.But I
> need help about my lucene question.
>
> I have one Index which has two fields. A and B
> Some values are like below
> A B
> _______________
>
> AC 10
> AC 20
> ACC 30
> ACC 40
> ACP 70
>
> I need lucene query to get results for only AC ..
> I fired query like 'A:AC' it gives me result all start with AC
> But i need exact match of query.
> Please help me out
>
>
> Awaiting for your positive reply.
> Thanks
>
>
> --
> Yogesh Patel
>