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 Alex Bredariol Grilo <ab...@gmail.com> on 2009/09/25 19:11:59 UTC

Search with whitespaces

Hi,
I'm new to Lucene and I'm trying to do some stuff with Lucene but I have
some problems.

I have some documents, in which some contain the word notebook written
separated,  e.g. "some dummy words note book other dummy words". And I'd
like that when I search notebook, these documents could be found and I'd
like to do it for a general case, like trying to search the words joining
the word before or after.

How could I do that? Is there an analyzer which tokenize like that?

Thank you


Alex

Re: Search with whitespaces

Posted by Robert Muir <rc...@gmail.com>.
Alex, to fix your compile problem, check to see if you have lucene 2.9 core
in your classpath.
The analyzers contrib depends upon this.

If you fix it so you can change TOKEN_SEPARATOR, maybe you want to submit a
patch? :)

On Tue, Sep 29, 2009 at 12:39 PM, Alex Bredariol Grilo <ab...@gmail.com>wrote:

> To use ShingleFilter, I'd like to change its TOKEN_SEPARATOR, but it's
> final. Furthermore, I tryed to compile its source code but the compiler
> isn't finding some methods like addAtribute.
> Does someone know how could I do that?
>
> Alex
>
> On Fri, Sep 25, 2009 at 2:42 PM, Robert Muir <rc...@gmail.com> wrote:
>
> > i might suggest the shingle package in lucene's contrib for this case.
> >
> > > like to do it for a general case, like trying to search the words
> joining
> > > > the word before or after.
> > > >
> > > > How could I do that? Is there an analyzer which tokenize like that?
> > > >
> > > > Thank you
> > > >
> > > >
> > > > Alex
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Alex
> > >
> >
> >
> >
> > --
> > Robert Muir
> > rcmuir@gmail.com
> >
>
>
>
> --
> Alex
>



-- 
Robert Muir
rcmuir@gmail.com

Re: Search with whitespaces

Posted by Alex Bredariol Grilo <ab...@gmail.com>.
To use ShingleFilter, I'd like to change its TOKEN_SEPARATOR, but it's
final. Furthermore, I tryed to compile its source code but the compiler
isn't finding some methods like addAtribute.
Does someone know how could I do that?

Alex

On Fri, Sep 25, 2009 at 2:42 PM, Robert Muir <rc...@gmail.com> wrote:

> i might suggest the shingle package in lucene's contrib for this case.
>
> > like to do it for a general case, like trying to search the words joining
> > > the word before or after.
> > >
> > > How could I do that? Is there an analyzer which tokenize like that?
> > >
> > > Thank you
> > >
> > >
> > > Alex
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > > For additional commands, e-mail: java-user-help@lucene.apache.org
> > >
> > >
> >
> >
> > --
> > Alex
> >
>
>
>
> --
> Robert Muir
> rcmuir@gmail.com
>



-- 
Alex

Re: Search with whitespaces

Posted by Robert Muir <rc...@gmail.com>.
i might suggest the shingle package in lucene's contrib for this case.

> like to do it for a general case, like trying to search the words joining
> > the word before or after.
> >
> > How could I do that? Is there an analyzer which tokenize like that?
> >
> > Thank you
> >
> >
> > Alex
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>
>
> --
> Alex
>



-- 
Robert Muir
rcmuir@gmail.com

Re: Search with whitespaces

Posted by Alex Bredariol Grilo <ab...@gmail.com>.
Yes, but I'd like to do it in a generic way. I wouldn't like to search if my
query contains the word "notebook".
Thank you

On Fri, Sep 25, 2009 at 2:33 PM, Zhang, Lisheng <
Lisheng.Zhang@broadvision.com> wrote:

> Hi,
>
> Simplest way is to add one condition (assuming field is f1):
>
> f1:notebook f1:"note book"
>
> which means (notebook OR "note book"), 2nd condition is phrase
> search.
>
> Best regards, Lisheng
>
> -----Original Message-----
> From: Alex Bredariol Grilo [mailto:abgrilo@gmail.com]
> Sent: Friday, September 25, 2009 10:12 AM
> To: java-user@lucene.apache.org
> Subject: Search with whitespaces
>
>
> Hi,
> I'm new to Lucene and I'm trying to do some stuff with Lucene but I have
> some problems.
>
> I have some documents, in which some contain the word notebook written
> separated,  e.g. "some dummy words note book other dummy words". And I'd
> like that when I search notebook, these documents could be found and I'd
> like to do it for a general case, like trying to search the words joining
> the word before or after.
>
> How could I do that? Is there an analyzer which tokenize like that?
>
> Thank you
>
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
Alex

RE: Search with whitespaces

Posted by "Zhang, Lisheng" <Li...@BroadVision.com>.
Hi,

Simplest way is to add one condition (assuming field is f1):

f1:notebook f1:"note book"

which means (notebook OR "note book"), 2nd condition is phrase
search.

Best regards, Lisheng

-----Original Message-----
From: Alex Bredariol Grilo [mailto:abgrilo@gmail.com]
Sent: Friday, September 25, 2009 10:12 AM
To: java-user@lucene.apache.org
Subject: Search with whitespaces


Hi,
I'm new to Lucene and I'm trying to do some stuff with Lucene but I have
some problems.

I have some documents, in which some contain the word notebook written
separated,  e.g. "some dummy words note book other dummy words". And I'd
like that when I search notebook, these documents could be found and I'd
like to do it for a general case, like trying to search the words joining
the word before or after.

How could I do that? Is there an analyzer which tokenize like that?

Thank you


Alex

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