proximity search not working when extending the QueryParser

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

proximity search not working when extending the QueryParser

Angelov, Rossen
When I'm using the QueryParser directly, the proximity search works fine and
getPhraseSlop() returns the correct slop int.

The problem is when I extend QueryParser. When extending it, getPhraseSlop
always returns the default value - 0. It's like setPhraseSlop is never
called.

Does anybody know if I have to parse the query, get the slop number and
explicitly call setPhraseSlop to have the proximity working or there is a
completely different way of doing it when extending the QueryParser?

Thanks,
Ross

"This communication is intended solely for the addressee and is
confidential and not for third party unauthorized distribution."

Reply | Threaded
Open this post in threaded view
|

Re: proximity search not working when extending the QueryParser

Erik Hatcher
Ross - could you please show us a bit of your code so we can see  
explicitly what you're doing and how it's not working as expected?  
set/getPhraseSlop are quite straightforward, so unless you're mixing  
up the static versus instance parse methods with QueryParser then I  
don't know what could be wrong at this point.

     Erik

On Jun 27, 2005, at 5:06 PM, Angelov, Rossen wrote:

> When I'm using the QueryParser directly, the proximity search works  
> fine and
> getPhraseSlop() returns the correct slop int.
>
> The problem is when I extend QueryParser. When extending it,  
> getPhraseSlop
> always returns the default value - 0. It's like setPhraseSlop is never
> called.
>
> Does anybody know if I have to parse the query, get the slop number  
> and
> explicitly call setPhraseSlop to have the proximity working or  
> there is a
> completely different way of doing it when extending the QueryParser?
>
> Thanks,
> Ross
>
> "This communication is intended solely for the addressee and is
> confidential and not for third party unauthorized distribution."
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: proximity search not working when extending the QueryParser

Angelov, Rossen
In reply to this post by Angelov, Rossen
Thanks for the response Erik.

I just realized that in my MultiFieldQueryParser that extends the
QueryParser I'm overwriting only getFieldQuery(String, String) and not
getFieldQuery(String, String, int). That will explain why getPhraseSlop
always returs 0.

May be I asked my question prematurely, so let me change the code, test it
and if there is still a problem I'll get back to the list for help.

Ross

-----Original Message-----
From: Erik Hatcher [mailto:[hidden email]]
Sent: Monday, June 27, 2005 6:40 PM
To: [hidden email]
Subject: Re: proximity search not working when extending the QueryParser


Ross - could you please show us a bit of your code so we can see  
explicitly what you're doing and how it's not working as expected?  
set/getPhraseSlop are quite straightforward, so unless you're mixing  
up the static versus instance parse methods with QueryParser then I  
don't know what could be wrong at this point.

     Erik

On Jun 27, 2005, at 5:06 PM, Angelov, Rossen wrote:

> When I'm using the QueryParser directly, the proximity search works  
> fine and
> getPhraseSlop() returns the correct slop int.
>
> The problem is when I extend QueryParser. When extending it,  
> getPhraseSlop
> always returns the default value - 0. It's like setPhraseSlop is never
> called.
>
> Does anybody know if I have to parse the query, get the slop number  
> and
> explicitly call setPhraseSlop to have the proximity working or  
> there is a
> completely different way of doing it when extending the QueryParser?
>
> Thanks,
> Ross
>
> "This communication is intended solely for the addressee and is
> confidential and not for third party unauthorized distribution."
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

"This communication is intended solely for the addressee and is
confidential and not for third party unauthorized distribution."