You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Greg Pendlebury <Gr...@usq.edu.au> on 2009/10/05 02:55:51 UTC

Always spellcheck (suggest)

Hi All,

If I understand correctly the flag 'onlyMorePopular' encapsulates two independent behaviours. 1) It runs spell checking across queries that returned hits. Without the flag spell checking is not run when results are found. 2) It limits suggestions to terms with higher frequencies.

Is there any way to get behaviour (1) without behaviour (2)? Such as another flag I'm not seeing in the doco? The usage context is spelling suggestions for international usage. Eg. The user searches 'behaviour', we want it to suggest US spelling 'behavior' and vice versa. At the moment, the suggestion only works one way.

Ta,
Greg


This email (including any attached files) is confidential and is for the
intended recipient(s) only.  If you received this email by mistake,
please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily
reflect those of the University of Southern Queensland.  Although all
reasonable precautions were taken to ensure that this email contained no
viruses at the time it was sent we accept no liability for any losses
arising from its receipt.

The University of Southern Queensland is a registered provider of
education with the Australian Government (CRICOS Institution Code No's.
QLD 00244B / NSW 02225M)



Re: Always spellcheck (suggest)

Posted by Christian Zambrano <cz...@gmail.com>.
Shalin,


Thanks for the clarification. That explains a lot. I should have looked 
at the lucene documentation.


On 10/05/2009 05:28 AM, Shalin Shekhar Mangar wrote:
> On Mon, Oct 5, 2009 at 10:24 AM, Christian Zambrano<cz...@gmail.com>wrote:
>
>    
>> I am really surprised that a query for "behaviour" returns "behavior" as a
>> suggestion only when the parameter "spellcheck.onlyMorePopular=true" is
>> present. I re-read the documentation and I see nothing that will imply that
>> the parameter onlyMorePopular will do anything else but filter the
>> suggestions solr will return.
>>
>> Maybe somebody else can shed some light on this.
>>
>>
>>      
> Yeah, that is true. All this is actually done in the Lucene SpellChecker.
> Solr's component is a wrapper over it with some extra features. I've added a
> clarification to the wiki page.
>
>    

Re: Always spellcheck (suggest)

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Mon, Oct 5, 2009 at 10:24 AM, Christian Zambrano <cz...@gmail.com>wrote:

> I am really surprised that a query for "behaviour" returns "behavior" as a
> suggestion only when the parameter "spellcheck.onlyMorePopular=true" is
> present. I re-read the documentation and I see nothing that will imply that
> the parameter onlyMorePopular will do anything else but filter the
> suggestions solr will return.
>
> Maybe somebody else can shed some light on this.
>
>
Yeah, that is true. All this is actually done in the Lucene SpellChecker.
Solr's component is a wrapper over it with some extra features. I've added a
clarification to the wiki page.

-- 
Regards,
Shalin Shekhar Mangar.

Re: Always spellcheck (suggest)

Posted by Christian Zambrano <cz...@gmail.com>.
I am really surprised that a query for "behaviour" returns "behavior" as 
a suggestion only when the parameter "spellcheck.onlyMorePopular=true" 
is present. I re-read the documentation and I see nothing that will 
imply that the parameter onlyMorePopular will do anything else but 
filter the suggestions solr will return.

Maybe somebody else can shed some light on this.

On 10/04/2009 09:51 PM, Greg Pendlebury wrote:
> Thanks. I'll have to look into modifications then (was hoping to avoid that).
>
> For clarity though I believe this point is slightly off:
>
>    
>>> "Adding the parameter onlyMorePopular limits the suggestions that solr can give you(to ones that return more hits than the existing query), nothing more."
>>>        
> The flag is definitely returning suggestions, even for 'correct' terms, they just have to be more popular 'correct' terms.
>
> Eg. 'behaviour' suggests 'behavior' because it has four times as many hits, but they are both 'correct' and the suggestion does not occur without the 'onlyMorePopular' flag set. 'behavior' will not suggest 'behaviour' however because it is less popular.
>
> Greg
>
> -----Original Message-----
> From: Christian Zambrano [mailto:czambran@gmail.com]
> Sent: Monday, 5 October 2009 12:41 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Always spellcheck (suggest)
>
> Greg,
>
> I apologize if I misunderstood your original post. I don't think there
> is a way you can force solr to return suggestions when all of the words
> are "correctly" spelled. Adding the parameter onlyMorePopular limits the
> suggestions that solr can give you(to ones that return more hits than
> the existing query), nothing more.
>
> In short, I believe the answer is No.
>
> On 10/04/2009 09:19 PM, Greg Pendlebury wrote:
>    
>> Thanks for the response Christian. I'll modify my original point (1) then. Is 'onlyMorePopular' the only way to return suggestions when all of the search terms are present in the dictionary (ie. correct)? Is there any way to force behaviour (1) without behaviour (2) (filtering on frequency).
>>
>> Ta,
>> Greg
>>
>> -----Original Message-----
>> From: Christian Zambrano [mailto:czambran@gmail.com]
>> Sent: Monday, 5 October 2009 11:59 AM
>> To: solr-user@lucene.apache.org
>> Subject: Re: Always spellcheck (suggest)
>>
>> I believe your understanding in incorrect. The first behavior you
>> described is produced by adding the paremeter "spellcheck=true".
>> Suggestions will be returned regardless of whether there are results.
>> The only time I believe spelling suggestions might not be included is
>> when all of the words are spelled "correctly".
>>
>> On 10/04/2009 07:55 PM, Greg Pendlebury wrote:
>>
>>      
>>> Hi All,
>>>
>>> If I understand correctly the flag 'onlyMorePopular' encapsulates two independent behaviours. 1) It runs spell checking across queries that returned hits. Without the flag spell checking is not run when results are found. 2) It limits suggestions to terms with higher frequencies.
>>>
>>> Is there any way to get behaviour (1) without behaviour (2)? Such as another flag I'm not seeing in the doco? The usage context is spelling suggestions for international usage. Eg. The user searches 'behaviour', we want it to suggest US spelling 'behavior' and vice versa. At the moment, the suggestion only works one way.
>>>
>>> Ta,
>>> Greg
>>>
>>>
>>> This email (including any attached files) is confidential and is for the
>>> intended recipient(s) only.  If you received this email by mistake,
>>> please, as a courtesy, tell the sender, then delete this email.
>>>
>>> The views and opinions are the originator's and do not necessarily
>>> reflect those of the University of Southern Queensland.  Although all
>>> reasonable precautions were taken to ensure that this email contained no
>>> viruses at the time it was sent we accept no liability for any losses
>>> arising from its receipt.
>>>
>>> The University of Southern Queensland is a registered provider of
>>> education with the Australian Government (CRICOS Institution Code No's.
>>> QLD 00244B / NSW 02225M)
>>>
>>>
>>>
>>>
>>>
>>>        
>> This email (including any attached files) is confidential and is for the
>> intended recipient(s) only.  If you received this email by mistake,
>> please, as a courtesy, tell the sender, then delete this email.
>>
>> The views and opinions are the originator's and do not necessarily
>> reflect those of the University of Southern Queensland.  Although all
>> reasonable precautions were taken to ensure that this email contained no
>> viruses at the time it was sent we accept no liability for any losses
>> arising from its receipt.
>>
>> The University of Southern Queensland is a registered provider of
>> education with the Australian Government (CRICOS Institution Code No's.
>> QLD 00244B / NSW 02225M)
>>
>>
>>
>>      
> This email (including any attached files) is confidential and is for the
> intended recipient(s) only.  If you received this email by mistake,
> please, as a courtesy, tell the sender, then delete this email.
>
> The views and opinions are the originator's and do not necessarily
> reflect those of the University of Southern Queensland.  Although all
> reasonable precautions were taken to ensure that this email contained no
> viruses at the time it was sent we accept no liability for any losses
> arising from its receipt.
>
> The University of Southern Queensland is a registered provider of
> education with the Australian Government (CRICOS Institution Code No's.
> QLD 00244B / NSW 02225M)
>
>
>    

RE: Always spellcheck (suggest)

Posted by Greg Pendlebury <Gr...@usq.edu.au>.
Thanks. I'll have to look into modifications then (was hoping to avoid that).

For clarity though I believe this point is slightly off:

>> "Adding the parameter onlyMorePopular limits the suggestions that solr can give you(to ones that return more hits than the existing query), nothing more."

The flag is definitely returning suggestions, even for 'correct' terms, they just have to be more popular 'correct' terms.

Eg. 'behaviour' suggests 'behavior' because it has four times as many hits, but they are both 'correct' and the suggestion does not occur without the 'onlyMorePopular' flag set. 'behavior' will not suggest 'behaviour' however because it is less popular.

Greg 

-----Original Message-----
From: Christian Zambrano [mailto:czambran@gmail.com] 
Sent: Monday, 5 October 2009 12:41 PM
To: solr-user@lucene.apache.org
Subject: Re: Always spellcheck (suggest)

Greg,

I apologize if I misunderstood your original post. I don't think there 
is a way you can force solr to return suggestions when all of the words 
are "correctly" spelled. Adding the parameter onlyMorePopular limits the 
suggestions that solr can give you(to ones that return more hits than 
the existing query), nothing more.

In short, I believe the answer is No.

On 10/04/2009 09:19 PM, Greg Pendlebury wrote:
> Thanks for the response Christian. I'll modify my original point (1) then. Is 'onlyMorePopular' the only way to return suggestions when all of the search terms are present in the dictionary (ie. correct)? Is there any way to force behaviour (1) without behaviour (2) (filtering on frequency).
>
> Ta,
> Greg
>
> -----Original Message-----
> From: Christian Zambrano [mailto:czambran@gmail.com]
> Sent: Monday, 5 October 2009 11:59 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Always spellcheck (suggest)
>
> I believe your understanding in incorrect. The first behavior you
> described is produced by adding the paremeter "spellcheck=true".
> Suggestions will be returned regardless of whether there are results.
> The only time I believe spelling suggestions might not be included is
> when all of the words are spelled "correctly".
>
> On 10/04/2009 07:55 PM, Greg Pendlebury wrote:
>    
>> Hi All,
>>
>> If I understand correctly the flag 'onlyMorePopular' encapsulates two independent behaviours. 1) It runs spell checking across queries that returned hits. Without the flag spell checking is not run when results are found. 2) It limits suggestions to terms with higher frequencies.
>>
>> Is there any way to get behaviour (1) without behaviour (2)? Such as another flag I'm not seeing in the doco? The usage context is spelling suggestions for international usage. Eg. The user searches 'behaviour', we want it to suggest US spelling 'behavior' and vice versa. At the moment, the suggestion only works one way.
>>
>> Ta,
>> Greg
>>
>>
>> This email (including any attached files) is confidential and is for the
>> intended recipient(s) only.  If you received this email by mistake,
>> please, as a courtesy, tell the sender, then delete this email.
>>
>> The views and opinions are the originator's and do not necessarily
>> reflect those of the University of Southern Queensland.  Although all
>> reasonable precautions were taken to ensure that this email contained no
>> viruses at the time it was sent we accept no liability for any losses
>> arising from its receipt.
>>
>> The University of Southern Queensland is a registered provider of
>> education with the Australian Government (CRICOS Institution Code No's.
>> QLD 00244B / NSW 02225M)
>>
>>
>>
>>
>>      
> This email (including any attached files) is confidential and is for the
> intended recipient(s) only.  If you received this email by mistake,
> please, as a courtesy, tell the sender, then delete this email.
>
> The views and opinions are the originator's and do not necessarily
> reflect those of the University of Southern Queensland.  Although all
> reasonable precautions were taken to ensure that this email contained no
> viruses at the time it was sent we accept no liability for any losses
> arising from its receipt.
>
> The University of Southern Queensland is a registered provider of
> education with the Australian Government (CRICOS Institution Code No's.
> QLD 00244B / NSW 02225M)
>
>
>    

This email (including any attached files) is confidential and is for the
intended recipient(s) only.  If you received this email by mistake,
please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily
reflect those of the University of Southern Queensland.  Although all
reasonable precautions were taken to ensure that this email contained no
viruses at the time it was sent we accept no liability for any losses
arising from its receipt.

The University of Southern Queensland is a registered provider of
education with the Australian Government (CRICOS Institution Code No's.
QLD 00244B / NSW 02225M)



Re: Always spellcheck (suggest)

Posted by Christian Zambrano <cz...@gmail.com>.
Greg,

I apologize if I misunderstood your original post. I don't think there 
is a way you can force solr to return suggestions when all of the words 
are "correctly" spelled. Adding the parameter onlyMorePopular limits the 
suggestions that solr can give you(to ones that return more hits than 
the existing query), nothing more.

In short, I believe the answer is No.

On 10/04/2009 09:19 PM, Greg Pendlebury wrote:
> Thanks for the response Christian. I'll modify my original point (1) then. Is 'onlyMorePopular' the only way to return suggestions when all of the search terms are present in the dictionary (ie. correct)? Is there any way to force behaviour (1) without behaviour (2) (filtering on frequency).
>
> Ta,
> Greg
>
> -----Original Message-----
> From: Christian Zambrano [mailto:czambran@gmail.com]
> Sent: Monday, 5 October 2009 11:59 AM
> To: solr-user@lucene.apache.org
> Subject: Re: Always spellcheck (suggest)
>
> I believe your understanding in incorrect. The first behavior you
> described is produced by adding the paremeter "spellcheck=true".
> Suggestions will be returned regardless of whether there are results.
> The only time I believe spelling suggestions might not be included is
> when all of the words are spelled "correctly".
>
> On 10/04/2009 07:55 PM, Greg Pendlebury wrote:
>    
>> Hi All,
>>
>> If I understand correctly the flag 'onlyMorePopular' encapsulates two independent behaviours. 1) It runs spell checking across queries that returned hits. Without the flag spell checking is not run when results are found. 2) It limits suggestions to terms with higher frequencies.
>>
>> Is there any way to get behaviour (1) without behaviour (2)? Such as another flag I'm not seeing in the doco? The usage context is spelling suggestions for international usage. Eg. The user searches 'behaviour', we want it to suggest US spelling 'behavior' and vice versa. At the moment, the suggestion only works one way.
>>
>> Ta,
>> Greg
>>
>>
>> This email (including any attached files) is confidential and is for the
>> intended recipient(s) only.  If you received this email by mistake,
>> please, as a courtesy, tell the sender, then delete this email.
>>
>> The views and opinions are the originator's and do not necessarily
>> reflect those of the University of Southern Queensland.  Although all
>> reasonable precautions were taken to ensure that this email contained no
>> viruses at the time it was sent we accept no liability for any losses
>> arising from its receipt.
>>
>> The University of Southern Queensland is a registered provider of
>> education with the Australian Government (CRICOS Institution Code No's.
>> QLD 00244B / NSW 02225M)
>>
>>
>>
>>
>>      
> This email (including any attached files) is confidential and is for the
> intended recipient(s) only.  If you received this email by mistake,
> please, as a courtesy, tell the sender, then delete this email.
>
> The views and opinions are the originator's and do not necessarily
> reflect those of the University of Southern Queensland.  Although all
> reasonable precautions were taken to ensure that this email contained no
> viruses at the time it was sent we accept no liability for any losses
> arising from its receipt.
>
> The University of Southern Queensland is a registered provider of
> education with the Australian Government (CRICOS Institution Code No's.
> QLD 00244B / NSW 02225M)
>
>
>    

RE: Always spellcheck (suggest)

Posted by Greg Pendlebury <Gr...@usq.edu.au>.
Thanks for the response Christian. I'll modify my original point (1) then. Is 'onlyMorePopular' the only way to return suggestions when all of the search terms are present in the dictionary (ie. correct)? Is there any way to force behaviour (1) without behaviour (2) (filtering on frequency).

Ta,
Greg

-----Original Message-----
From: Christian Zambrano [mailto:czambran@gmail.com] 
Sent: Monday, 5 October 2009 11:59 AM
To: solr-user@lucene.apache.org
Subject: Re: Always spellcheck (suggest)

I believe your understanding in incorrect. The first behavior you 
described is produced by adding the paremeter "spellcheck=true". 
Suggestions will be returned regardless of whether there are results. 
The only time I believe spelling suggestions might not be included is 
when all of the words are spelled "correctly".

On 10/04/2009 07:55 PM, Greg Pendlebury wrote:
> Hi All,
>
> If I understand correctly the flag 'onlyMorePopular' encapsulates two independent behaviours. 1) It runs spell checking across queries that returned hits. Without the flag spell checking is not run when results are found. 2) It limits suggestions to terms with higher frequencies.
>
> Is there any way to get behaviour (1) without behaviour (2)? Such as another flag I'm not seeing in the doco? The usage context is spelling suggestions for international usage. Eg. The user searches 'behaviour', we want it to suggest US spelling 'behavior' and vice versa. At the moment, the suggestion only works one way.
>
> Ta,
> Greg
>
>
> This email (including any attached files) is confidential and is for the
> intended recipient(s) only.  If you received this email by mistake,
> please, as a courtesy, tell the sender, then delete this email.
>
> The views and opinions are the originator's and do not necessarily
> reflect those of the University of Southern Queensland.  Although all
> reasonable precautions were taken to ensure that this email contained no
> viruses at the time it was sent we accept no liability for any losses
> arising from its receipt.
>
> The University of Southern Queensland is a registered provider of
> education with the Australian Government (CRICOS Institution Code No's.
> QLD 00244B / NSW 02225M)
>
>
>
>    

This email (including any attached files) is confidential and is for the
intended recipient(s) only.  If you received this email by mistake,
please, as a courtesy, tell the sender, then delete this email.

The views and opinions are the originator's and do not necessarily
reflect those of the University of Southern Queensland.  Although all
reasonable precautions were taken to ensure that this email contained no
viruses at the time it was sent we accept no liability for any losses
arising from its receipt.

The University of Southern Queensland is a registered provider of
education with the Australian Government (CRICOS Institution Code No's.
QLD 00244B / NSW 02225M)



Re: Always spellcheck (suggest)

Posted by Christian Zambrano <cz...@gmail.com>.
I believe your understanding in incorrect. The first behavior you 
described is produced by adding the paremeter "spellcheck=true". 
Suggestions will be returned regardless of whether there are results. 
The only time I believe spelling suggestions might not be included is 
when all of the words are spelled "correctly".

On 10/04/2009 07:55 PM, Greg Pendlebury wrote:
> Hi All,
>
> If I understand correctly the flag 'onlyMorePopular' encapsulates two independent behaviours. 1) It runs spell checking across queries that returned hits. Without the flag spell checking is not run when results are found. 2) It limits suggestions to terms with higher frequencies.
>
> Is there any way to get behaviour (1) without behaviour (2)? Such as another flag I'm not seeing in the doco? The usage context is spelling suggestions for international usage. Eg. The user searches 'behaviour', we want it to suggest US spelling 'behavior' and vice versa. At the moment, the suggestion only works one way.
>
> Ta,
> Greg
>
>
> This email (including any attached files) is confidential and is for the
> intended recipient(s) only.  If you received this email by mistake,
> please, as a courtesy, tell the sender, then delete this email.
>
> The views and opinions are the originator's and do not necessarily
> reflect those of the University of Southern Queensland.  Although all
> reasonable precautions were taken to ensure that this email contained no
> viruses at the time it was sent we accept no liability for any losses
> arising from its receipt.
>
> The University of Southern Queensland is a registered provider of
> education with the Australian Government (CRICOS Institution Code No's.
> QLD 00244B / NSW 02225M)
>
>
>
>