lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a peng <zhoudengp...@gmail.com>
Subject Re: A question regarding the setSlop method of class PhraseQuery (Lucene version 3.0.1)
Date Mon, 28 Jun 2010 06:07:51 GMT
Hi,

I am using StandardAnalyzer(Version.LUCENE_30);

2010/6/27 tarun sapra <t.sapra97@gmail.com>

> which analyzer are you usin'?
>
>
> On Sun, Jun 27, 2010 at 7:12 AM, a peng <zhoudengpeng@gmail.com> wrote:
>
> > Hi,
> >
> > I know the indexed content contains the following text: "This is a test".
> > And the search phrase I used is "This is a formal test", and then I set
> the
> > slop of the PhraseQuery as 2 with setSlop(2), but I found that I can not
> > get
> > a search result. If I set the search phrase as "This is formal test",
> then
> > I
> > can get the search result.
> >
> > So what is the problem here, thanks in advance.
> >
> >
> > Attached is the Java doc for the setSlop method:
> >
> > public void *setSlop*(int s)
> >
> > Sets the number of other words permitted between words in query phrase.
> If
> > zero, then this is an exact phrase search. For larger values this works
> > like
> > a WITHIN or NEAR operator.
> >
> > The slop is in fact an edit-distance, where the units correspond to moves
> > of
> > terms in the query phrase out of position. For example, to switch the
> order
> > of two words requires two moves (the first move places the words atop one
> > another), so to permit re-orderings of phrases, the slop must be at least
> > two.
> >
> > More exact matches are scored higher than sloppier matches, thus search
> > results are sorted by exactness.
> >
> > The slop is zero by default, requiring exact matches.
> >
>
>
>
> --
> Thanks & Regards
> Tarun Sapra
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message