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

Add doc match score support to percolate api #13827

Closed
ncolomer opened this issue Sep 28, 2015 · 5 comments
Closed

Add doc match score support to percolate api #13827

ncolomer opened this issue Sep 28, 2015 · 5 comments
Labels
good first issue low hanging fruit help wanted adoptme :Search/Percolator Reverse search: find queries that match a document

Comments

@ncolomer
Copy link

The percolate API documentation mentions track_scores and sort options in the Additional request body options section. More precisely, we can read the following notes, respectively:

The _score is based on the query and represents how the query matched the percolate query’s metadata, not how the document (that is being percolated) matched the query.
[...]
Like track_score the score is based on the query and represents how the query matched to the percolate query’s metadata and not how the document being percolated matched to the query.

I'm wondering why there is nothing in the API about the score of the document itself (being percolated) among the various percolator queries?

I read somewhere that this would be due to hit score being relative to its resultset, and that in a percolator query, we only consider one document at a time, so the score on each percolator query is not really relevant.

I was expecting #3506 to be the solution, but it's not related after having a look. Such a feature is also mentioned here in the mailing list but there is no technical answer.

Can you confirm? Is there any way/plan to get a percolation score?

@martijnvg
Copy link
Member

@ncolomer Scoring how percolator queries match with the document being percolated requires different scoring then exists today in search which is based tf/idf. But this feature is interesting and I think this should be made possible in the percolate api. I think the score should be based on proximity, how close the matches are in the document being percolated.

@ncolomer
Copy link
Author

@martijnvg thanks for your answer!

You mean that, the way percolation is implemented today, it does not benefit from internal scoring tools (that the regular search API does for instance)?

Actually, this score would be useful to compare 2 consecutive docs being percolated: if they both match the same percolation query, it might be interesting to give them a score (ie. how well they match the query) to compare them.

@martijnvg
Copy link
Member

You mean that, the way percolation is implemented today, it does not benefit from internal scoring tools (that the regular search API does for instance)?

Right now there is just no scoring on how a query matches with the document being percolated. So I think this should be added at some point. The score that is being returned by the percolate api is just how the percolator query in the percolate api matches with the metadata on the percolator query.

@clintongormley clintongormley added high hanging fruit discuss :Search/Percolator Reverse search: find queries that match a document labels Oct 2, 2015
@martijnvg
Copy link
Member

Now that the core percolator has been refactored to be a Lucene query adding scoring to the percolator has been made much easier. And with the upcoming refactoring in #16349 (replacing the percolate api with percolator query in query dsl) exposing the scores from how queries match with the MemoryIndex becomes a low hanging fruit. (right now the percolator just ignores that score)

@martijnvg martijnvg added good first issue low hanging fruit and removed high hanging fruit labels Feb 3, 2016
@martijnvg martijnvg added help wanted adoptme and removed discuss labels Mar 29, 2016
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Mar 31, 2016
Percolator query documents are scored based on how well they match with the document being percolated.

Closes elastic#13827
@ncolomer
Copy link
Author

Thanks a lot @martijnvg! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue low hanging fruit help wanted adoptme :Search/Percolator Reverse search: find queries that match a document
Projects
None yet
Development

No branches or pull requests

3 participants