I am currently working on implementing autocomplete functionality. So far I have looked into the following options:
Completion suggester. We would like query-time ranking such that we can e.g. base it on term frequency, which does not seem to be possible with the completion suggester.
NGram Tokenizer. If I understand correctly, this would greatly increase the index size.
match_phrase_prefix. Is described as a poor man's autocomplete, but returns a full hit list like a regular search request.
Are there any other options, or should I look into writing a plugin? Ideally, I would like a phrase suggester that not only gives spelling suggestions but also autocomplete suggestions.
You could either build the 7.x branch locally by running ./gradlew assemble or download a snapshot (note, this link will not be updated with newer snapshots)
Thanks, I have experimented with it for a bit and I like the suggestions it gives. Is there a way to take multiple documents into account? Let's say "test" occurs many times in an index and "testing" occurs only once, could it rank "test" higher than "testing" in that case?
Not sure I understand the 'taking multiple documents into account' part. Scoring works like a regular search, so each document gets scored against the query.
You however have all the power of a boolean query on top of this, so you could play around with some should queries to influence the score for example.
I was trying to say that I would like the scoring of a suggestion to take into account term frequencies over the entire index, so it would give terms with higher frequency a higher ranking.
But since this is a regular search that results in a hit list of documents (and not a list of ranked terms/suggestions), I guess this may only be possible using aggregations.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.