Skip to content

Scoring in RediSearch#1254

Merged
mgravell merged 2 commits intoStackExchange:masterfrom
jjchiw:nredisearch-scoring
Feb 27, 2020
Merged

Scoring in RediSearch#1254
mgravell merged 2 commits intoStackExchange:masterfrom
jjchiw:nredisearch-scoring

Conversation

@jjchiw
Copy link
Copy Markdown
Contributor

@jjchiw jjchiw commented Oct 16, 2019

#1251

Scoring in RediSearch

Allow to set scoring (pre-bundled scoring function)

args.Add("SCORER".Literal());
args.Add(Scoring);

if (ExplainScore)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jjchiw EXPLAINSCORE should stand on its own and is not only limited to cases where SCORER is used

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think EXPLAINSCORE literal it depends on SCORER (https://oss.redislabs.com/redisearch/Commands.html#ftsearch)

FT.SEARCH {index} {query} [NOCONTENT] [VERBATIM] [NOSTOPWORDS] [WITHSCORES] [WITHPAYLOADS] [WITHSORTKEYS]
  [FILTER {numeric_field} {min} {max}] ...
  [GEOFILTER {geo_field} {lon} {lat} {radius} m|km|mi|ft]
  [INKEYS {num} {key} ... ]
  [INFIELDS {num} {field} ... ]
  [RETURN {num} {field} ... ]
  [SUMMARIZE [FIELDS {num} {field} ... ] [FRAGS {num}] [LEN {fragsize}] [SEPARATOR {separator}]]
  [HIGHLIGHT [FIELDS {num} {field} ... ] [TAGS {open} {close}]]
  [SLOP {slop}] [INORDER]
  [LANGUAGE {language}]
  [EXPANDER {expander}]
  [SCORER {scorer}] [EXPLAINSCORE]
  [PAYLOAD {payload}]
  [SORTBY {field} [ASC|DESC]]
  [LIMIT offset num]

Assert.Contains("", args);
Assert.Contains("SCORER".Literal(), args);
Assert.Contains("TFIDF.DOCNORM", args);
Assert.Contains("EXPLAINSCORE".Literal(), args);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jjchiw I think you should also add a test that runs a Search with EXPLAINSCORE and validate the result

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mgravell
Copy link
Copy Markdown
Collaborator

mgravell commented Feb 3, 2020

Hi @jjchiw ; there's some feedback here from @gkorland - do you have chance to look at it so we can merge this?

@jjchiw
Copy link
Copy Markdown
Contributor Author

jjchiw commented Feb 3, 2020

Sure... I'll check it out during the week...

@jjchiw
Copy link
Copy Markdown
Contributor Author

jjchiw commented Feb 9, 2020

There are two tests that are failing, I think it's because of the redis version

image

image

# Server
redis_version:5.0.7
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:9d06145e39725623
redis_mode:standalone
os:Linux 4.19.76-linuxkit x86_64

@mgravell
Copy link
Copy Markdown
Collaborator

mgravell commented Feb 9, 2020 via email

@mgravell
Copy link
Copy Markdown
Collaborator

This is looking great; just as a double-check, can I confirm that you're able and willing (and thus: doing so) to freely contribute this code to the project under the project's license?

@jjchiw
Copy link
Copy Markdown
Contributor Author

jjchiw commented Feb 27, 2020

Yes, I am willing to freely contribute this code to the project under the projec'ts license.

:)

@mgravell
Copy link
Copy Markdown
Collaborator

Merging, thanks; I'll get this added to the 2.1 release notes

@mgravell mgravell merged commit d647bfb into StackExchange:master Feb 27, 2020
NickCraver pushed a commit that referenced this pull request Mar 13, 2020
Fixes a break from #1254
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.

3 participants