Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Term suggestions sorted by weight/frequency #34

Open
gladwig opened this issue Oct 23, 2014 · 1 comment
Open

Term suggestions sorted by weight/frequency #34

gladwig opened this issue Oct 23, 2014 · 1 comment

Comments

@gladwig
Copy link

gladwig commented Oct 23, 2014

Hi,
I noticed that the terms returned by the FST suggester are always sorted alphabetically. However, I would like to have them sorted by frequency. As far as I can tell, this would require changing the ShardSuggestResponse to include not only the terms but also their weight and then aggregating the shard responses in TransportSuggestAction.newResponse to form a list of all suggestions sorted by weight. While doing that one could also expose the number of buckets used by FSTCompletionLookup as a configuration setting and alternatively also support using WFSTCompletionLookup.

But, before I start with any of that:

  • Are you open to accepting a pull request making these changes?
  • Do you know if there is another way to get term completion suggestion sorted by frequency? I think that the new ES completion suggester is not the right fit since I want it to suggest single terms.

Thanks!

@spinscale
Copy link
Owner

hey,

sorry for the late response. I am surely open for a PR, as long as tests cover the new functionality :-)

Regarding your second question: Did you check out the term suggester in Elasticsearch? See http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-term.html#search-suggesters-term

That one allows you to search for single terms based on their frequency (and even sort on that).

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

No branches or pull requests

2 participants