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

Mailing List Archive: Lucene: Java-User

multiple Tokens in a Tokengroup not matching

 

 

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


daves at cyc

Sep 14, 2007, 6:59 AM

Post #1 of 2 (1000 views)
Permalink
multiple Tokens in a Tokengroup not matching

Hi,

I've inherited some Lucene 1.9.1 code, and have run into the following
problem:

I have a TokenGroup with multiple tokens in it, and a query that should
match against multiple tokens (e.g. X and Y) in the TokenGroup.
However, when I look in the Hit that results, I see that one of the
Tokens in the TokenGroup has a weight of 1.0, while all the rest have a
weight of 0. If I run a search with just X in the query, it matches the
TokenGroup, and when I run a search with just Y in the query, it also
matches the TokenGroup, just as I'd expect. But a query that includes
both X and Y looks like only X matches. I need to see that both X and Y
matched in order to get my highlighting to work correctly.

Can anyone provide any hints as to what might be going on here, and what
I might do to fix it? We have a vague suspicion that it's related to
the weight on the matching token being 1.0 that's causing Lucene to not
both with any other tokens (because the weight for the TokenGroup is
already as high as it can be), but it's just a suspicion.

Thanks,

Dave Schneider


erickerickson at gmail

Sep 15, 2007, 3:39 PM

Post #2 of 2 (899 views)
Permalink
Re: multiple Tokens in a Tokengroup not matching [In reply to]

I really can't tell much from your e-mail. What I'd recommend is
that you get a copy of Luke and examine your index (including
your query and it's results). Also, try query.toString() to see what
the actual query submitted to Lucene is, that may give you some
clues as to what's going on.

If the results make no sense, think about posting the results of
the toString and/or the Luke explain to the list and I suspect
you'll get a more helpful response.

Imagine that you had been given your e-mail while knowing nothing
about the application. There's not much "there" there <G>. More
detail would help us give you a more helpful response....

That said, it's tough getting a bunch of code dropped on your
head and being told "fix it". Been there, done that. Not much fun.

Best
Erick


On 9/14/07, Dave Schneider <daves [at] cyc> wrote:
>
> Hi,
>
> I've inherited some Lucene 1.9.1 code, and have run into the following
> problem:
>
> I have a TokenGroup with multiple tokens in it, and a query that should
> match against multiple tokens (e.g. X and Y) in the TokenGroup.
> However, when I look in the Hit that results, I see that one of the
> Tokens in the TokenGroup has a weight of 1.0, while all the rest have a
> weight of 0. If I run a search with just X in the query, it matches the
> TokenGroup, and when I run a search with just Y in the query, it also
> matches the TokenGroup, just as I'd expect. But a query that includes
> both X and Y looks like only X matches. I need to see that both X and Y
> matched in order to get my highlighting to work correctly.
>
> Can anyone provide any hints as to what might be going on here, and what
> I might do to fix it? We have a vague suspicion that it's related to
> the weight on the matching token being 1.0 that's causing Lucene to not
> both with any other tokens (because the weight for the TokenGroup is
> already as high as it can be), but it's just a suspicion.
>
> Thanks,
>
> Dave Schneider
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>

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.