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

Arcadius Ahouansou edited comment on SOLR-7888 at 8/19/15 1:41 AM:
-------------------------------------------------------------------

Hello [~janhoy].
Sorry I have been away for quite a while.

I have just uploaded an updated version of the patch.
Changes dones are as follow:

- No need to pass the query field anymore. the internal 
{{AnalyzingInfixSuggester.CONTEXTS_FIELD_NAME}} is used as query field i.e. the 
recommended way to filter is just {{"ctx2 AND ctx3"}} instead of the old way 
{{"contexts:ctx2 AND contexts:ctx3"}}

- Most of the logic for parsing queries has been moved from 
{{SuggestComponent.java}} into {{SolrSuggester.java}}

- Multiple suggester can be configured, each one having a different analyzer 
for the context field as the query parsing in now done in the SolrSuggester. 

- The {{contextAnalyzerFieldType}} config is optional and by default, the 
analyzer of the context field will be used

- There is a test 
{{testContextFilterParamIsIgnoredWhenContextIsNotImplemented()}} to test that 
if you send context filtering query to a suggester that does not support 
context, the filtering is just ignored and suggest return result.
Along the same line, there is also a test 
{{testContextFilteringIsIgnoredWhenContextIsImplementedButNotConfigured()}}
So, the implementation is more friendly now.

- Suggester build will throw exception only if you configure context in 
solrconfig.xml on a suggester that does not support context. But queries still 
return normally, just the build operation for the concerned suggester fails.
There is a test 
{{testBuildThrowsIllegalArgumentExceptionWhenContextIsConfiguredButNotImplemented()}}
 to cover that

- buildAll will fail for all (not just the concerned suggester) if you 
configure context in solrconfig.xml on a suggester that does not support context

- Regarding the parameter name. The initial implementation if did used the name 
{{suggest.cfq}} for ContextFilterQuery. Then I looked at 
{{suggest.dictionary}}, {{suggest.reloadAll}} etc which are plain English. For 
now, I have not yet changed the name. I will change it as soon as we agreed on 
that.


Please let me know in case I have missed anything you mentioned.

Thank you very much.

Arcadius


was (Author: arcadius):
Hello [~janhoy].
Sorry I have been away for quite a while.

I have just uploaded an updated version of the patch.
Changes dones are as follow:

- No need to pass the query field anymore. the internal 
{{AnalyzingInfixSuggester.CONTEXTS_FIELD_NAME}} is used as query field i.e. the 
recommended way to filter is just {{"ctx2 AND ctx3"}} instead of the old way 
{{"contexts:ctx2 AND contexts:ctx3"}}

- Most of the logic for parsing queries has been moved into 
{{SuggestComponent.java}} to {{SolrSuggester.java}}

- Multiple suggester can be configured, each one having a different analyzer 
for the context field. 

- The {{contextAnalyzerFieldType}} config is optional and by default, the 
analyzer of the context field will be used

- There is a test 
{{testContextFilterParamIsIgnoredWhenContextIsNotImplemented()}} to test that 
if you send context filtering query to a suggester that does not support 
context, the filtering is just ignored and suggest return result.
Along the same line, there is also a test 
{{testContextFilteringIsIgnoredWhenContextIsImplementedButNotConfigured()}}
So, the implementation is more friendly now.

- Suggester build will throw exception only if you configure context in 
solrconfig.xml on a suggester that does not support context. But queries still 
return normally, just the build operation for the concerned suggester fails.
There is a test 
{{testBuildThrowsIllegalArgumentExceptionWhenContextIsConfiguredButNotImplemented()}}
 to cover that

- buildAll will fail for all (not just the concerned suggester) if you 
configure context in solrconfig.xml on a suggester that does not support context

- Regarding the parameter name. The initial implementation if did used the name 
{{suggest.cfq}} for ContextFilterQuery. Then I looked at 
{{suggest.dictionary}}, {{suggest.reloadAll}} etc which are plain English. For 
now, I have not yet changed the name. I will change it as soon as we agreed on 
that.


Please let me know in case I have missed anything you mentioned.

Thank you very much.

Arcadius

> 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
>            Assignee: Jan Høydahl
>             Fix For: 5.4
>
>         Attachments: SOLR-7888.patch, 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-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to