Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the case when using order_by_function with Solr strdist #572

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

morellan
Copy link

@morellan morellan commented May 7, 2014

When using the Solr strdist FunctionQuery with the new order_by_function it is required to include a distance measure to use, but sunspot consider each param as it were fields, this pull request fixes that situation.

valid_measures = [:jw, :edit, :ngram]

* Added testing with valid and invalid measure options
@ma2kubo
Copy link

ma2kubo commented May 7, 2014

Evernote was unable to submit your note for the following reason:

The emailed note was received, but Evernote did not understand the email address. It may have been mistyped, or the user may not exist. Please check to make sure the address was properly entered.

Original message information:
From: =?UTF-8?B?TWF0w61hcyBPcmVsbGFuYQ==?= <[email protected]>
Delivered To: [email protected]
All recipients: sunspot/sunspot <[email protected]>
Subject: [sunspot] Fix the case when using order_by_function with Solr strdist (#572)

To prevent excessive emails, you may not receive another error reply for the next 360 minutes.

  • The Evernote team

@thomasdarde
Copy link

Very useful !
I hope it'll be merged

@ma2kubo
Copy link

ma2kubo commented Jun 4, 2014

Evernote was unable to submit your note for the following reason:

The emailed note was received, but Evernote did not understand the email address. It may have been mistyped, or the user may not exist. Please check to make sure the address was properly entered.

Original message information:
From: Thomas Darde <[email protected]>
Delivered To: [email protected]
All recipients: sunspot/sunspot <[email protected]>; ma2kubo <[email protected]>
Subject: Re: [sunspot] Fix the case when using order_by_function with Solr strdist (#572)

To prevent excessive emails, you may not receive another error reply for the next 360 minutes.

  • The Evernote team

@njakobsen
Copy link
Contributor

Why not just accept any arguments to strdist and let solr explode if the param is invalid instead of needing to keep a list of valid measures up to date with solr?

else
raise(
UnrecognizedRestrictionError,
"Use only valid measure options with strdist (#{valid_measures.to_s})"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants