[ 
https://issues.apache.org/jira/browse/LUCENE-6459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14535556#comment-14535556
 ] 

Michael McCandless commented on LUCENE-6459:
--------------------------------------------

Thanks [~areek], this is a big patch!  I'm trying to wrap my brain around it... 
it will
take some iterations :)

The filled-out javadocs are nice.

It seems like the overall idea is to make a generic index-time and
search-time API that other suggesters could use, but for now it's just
NRTSuggester using it?  Do we expect the non-document based suggesters
to also eventually be able to use this API?

One thing we are struggling with on AnalyzingInfixSuggester is how to
allow arbitrary context filters (LUCENE-6464) ... I wonder if this API
would make that easier.

This patch also adds new capabilities to NRTSuggester, like fuzzy and
regexp suggestions?  What other new functions are exposed?  What
use-cases do you see for RegexCompletionQuery?

Should FSTPath.toString also include the context?

The search side largely mirrors/subclasses Lucene's normal search
classes (CompletionQuery, CompletionWeight, SuggestIndexSearcher,
etc.) but there are some differences, e.g. we pass an Analyzer to the
completion queries (so they can build the automaton).

If you try to use ContextQuery against a field that you had not
indexed contexts with (using ContextSuggestField) do you see any
error?  Maybe this is too hard.

Are you allowed to mix ContextSuggestField and SuggestField even for
the same field name, within one suggester?

> [suggest] Query Interface for suggest API
> -----------------------------------------
>
>                 Key: LUCENE-6459
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6459
>             Project: Lucene - Core
>          Issue Type: New Feature
>          Components: core/search
>    Affects Versions: 5.1
>            Reporter: Areek Zillur
>            Assignee: Areek Zillur
>             Fix For: Trunk, 5.x, 5.1
>
>         Attachments: LUCENE-6459.patch, LUCENE-6459.patch, LUCENE-6459.patch
>
>
> Related Issue: 
> [NRTSuggester|https://issues.apache.org/jira/browse/LUCENE-6339]
> h3. Suggest API:
> {code}
> SuggestIndexSearcher searcher = new SuggestIndexSearcher(reader);
> CompletionQuery query = ...
> TopSuggestDocs suggest = searcher.suggest(query, num);
> {code}
> h3. Query Interface
> h4. PrefixCompletionQuery
> Return documents with values that match the prefix of an analyzed term text 
> Documents are sorted according to their suggest field weight. 
> {code}
> PrefixCompletionQuery(Analyzer analyzer, Term term)
> {code}
> h4. RegexCompletionQuery
> Return documents with values that match the prefix of a regular expression
> Documents are sorted according to their suggest field weight.
> {code}
> RegexCompletionQuery(Term term)
> {code}
> h4. FuzzyCompletionQuery
> Return documents with values that has prefixes within a specified edit 
> distance of an analyzed term text.
> Documents are ‘boosted’ by the number of matching prefix letters of the 
> suggestion with respect to the original term text.
> {code}
> FuzzyCompletionQuery(Analyzer analyzer, Term term)
> {code}
> h5. Scoring
> {{suggestion_weight + (global_maximum_weight * boost)}}
> where {{suggestion_weight}}, {{global_maximum_weight}} and {{boost}} are all 
> integers. 
> {{boost = # of prefix characters matched}}
> h4. ContextQuery
> Return documents that match a {{CompletionQuery}} filtered and/or boosted by 
> provided context(s). 
> {code}
> ContextQuery(CompletionQuery query)
> contextQuery.addContext(CharSequence context, int boost, boolean exact)
> {code}
> *NOTE:* {{ContextQuery}} should be used with {{ContextSuggestField}} to query 
> suggestions boosted and/or filtered by contexts
> h5. Scoring
> {{suggestion_weight + (global_maximum_weight * context_boost)}}
> where {{suggestion_weight}}, {{global_maximum_weight}} and {{context_boost}} 
> are all integers
> When used with {{FuzzyCompletionQuery}},
> {{suggestion_weight + (global_maximum_weight * (context_boost + 
> fuzzy_boost))}}
> h3. Context Suggest Field
> To use {{ContextQuery}}, use {{ContextSuggestField}} instead of 
> {{SuggestField}}. Any {{CompletionQuery}} can be used with 
> {{ContextSuggestField}}, the default behaviour is to return suggestions from 
> *all* contexts. {{Context}} for every completion hit can be accessed through 
> {{SuggestScoreDoc#context}}.
> {code}
> ContextSuggestField(String name, Collection<CharSequence> contexts, String 
> value, int weight) 
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to