lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arcadius Ahouansou (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (SOLR-7888) Make Lucene's AnalyzingInfixSuggester.lookup() method that takes a BooleanQuery filter parameter available in Solr
Date Sun, 09 Aug 2015 16:02:45 GMT

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

Arcadius Ahouansou edited comment on SOLR-7888 at 8/9/15 4:02 PM:
------------------------------------------------------------------

Hello [~janhoy]

- The {{defaultField}} thing is an excellent idea! Will add that

- I will change the param to {{suggest.contextQ}}

- About the {{contextAnalyzerFieldType}} config, it seems we may not need that because as
we know the {{contextField}}, I was able to do  something like {code}Analyzer queryAnalyzer
= core.getLatestSchema().getFieldType(contextsField).getQueryAnalyzer(){code} 




About multivalue: the source field in the current test is defined as 
{code}<field name="contexts" type="text" indexed="true" stored="true" multiValued="true"/>{code}

and we have tests where we index data with multiple contexts
{code}
    assertU(adoc("id", "8", "cat", "example inputdata", "price", "45", "weight", "30", "contexts",
"ctx2", "contexts", "ctx3"));
{code}
and we check both contexts with an {{AND}}
{code}
    //AND BooleanQuery
    assertQ(req("qt", rh,
            SuggesterParams.SUGGEST_BUILD, "true",
            SuggesterParams.SUGGEST_DICT, "suggest_blended_infix_suggester",
            SuggesterParams.SUGGEST_CONTEXT_FILER_QUERY, "contexts:ctx2 AND contexts:ctx3",
            SuggesterParams.SUGGEST_Q, "examp",
            SuggesterParams.SUGGEST_COUNT, "5"),
        "//lst[@name='suggest']/lst[@name='suggest_blended_infix_suggester']/lst[@name='examp']/int[@name='numFound'][.='1']"
    );
{code}
I hope this satisfies your requirement?


was (Author: arcadius):
Hello [~janhoy]

- The {{defaultField}} thing is an excellent idea! Will add that

- I will change the param to {{suggest.contextQ}}

- About the {{contextAnalyzerFieldType}} config, it seems we may not need that because as
we know the {{contextField}}, I was able to do  something like {code}Analyzer queryAnalyzer
= core.getLatestSchema().getFieldType(contextsField).getQueryAnalyzer(){code} 




About multivalue: the source field in the current test is defined as 
{code}<field name="contexts" type="text" indexed="true" stored="true" multiValued="true"/>{code}

and we have tests where we index data with multiple contexts
{code}
    assertU(adoc("id", "8", "cat", "example inputdata", "price", "45", "weight", "30", "contexts",
"ctx2", "contexts", "ctx3"));
{code}
and we check both contexts with an {{AND}}
{code}
    //AND BooleanQuery
    assertQ(req("qt", rh,
            SuggesterParams.SUGGEST_BUILD, "true",
            SuggesterParams.SUGGEST_DICT, "suggest_blended_infix_suggester",
            SuggesterParams.SUGGEST_CONTEXT_FILER_QUERY, "contexts:ctx2 AND contexts:ctx3",
            SuggesterParams.SUGGEST_Q, "examp",
            SuggesterParams.SUGGEST_COUNT, "5"),
        "//lst[@name='suggest']/lst[@name='suggest_blended_infix_suggester']/lst[@name='examp']/int[@name='numFound'][.='1']"
    );
{code}

> Make Lucene's AnalyzingInfixSuggester.lookup() method that takes a BooleanQuery filter
parameter available in Solr
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-7888
>                 URL: https://issues.apache.org/jira/browse/SOLR-7888
>             Project: Solr
>          Issue Type: New Feature
>          Components: Suggester
>    Affects Versions: 5.2.1
>            Reporter: Arcadius Ahouansou
>         Attachments: SOLR-7888.patch
>
>
>  LUCENE-6464 has introduced a very flexible lookup method that takes as parameter a BooleanQuery
that is used for filtering results.
> This ticket is to expose that method to Solr.
> This would allow user to do:
> {code}
> /suggest?suggest=true&suggest.build=true&suggest.q=term&suggest.contextFilterQuery=contexts:tennis
> /suggest?suggest=true&suggest.build=true&suggest.q=term&suggest.contextFilterQuery=contexts:golf
AND contexts:football
> {code}
> etc
> Given that the context filtering in currently only implemented by the {code}AnalyzingInfixSuggester{code}
and by the {code}BlendedInfixSuggester{code}, this initial implementation will support only
these 2 lookup implementations.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message