Hello ,

I opened a bug issue not knowing it's not the correct place to ask the
question at hand,
So I was directed to send an e-mail to the mailing list, hopefully I'm
correct this time.

Here's a link to the issue opened:
https://issues.apache.org/jira/browse/SOLR-14780?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel

And below you'll find again the same information in case it's deleted or
you do not have access to it anymore.

I'm experiencing problem when I try to use Context Filtering with auto
suggester. What I want is to filter the suggestions based on *url field*

Here is my searchComponent:

 <lst name="suggester">
 <str name="name">AnalyzingInfixSuggester</str>
 <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
 <str name="dictionaryImpl">DocumentDictionaryFactory</str>
 <str name="field">main_title</str>
 <str name="weightField">main_title</str>
 <str name="contextField">url</str>
 <str name="suggestAnalyzerFieldType">text_general</str>
 </lst>


Here are the fields in my schema:

<field name="main_title" type="string" indexed="true" stored="true"/>
 <field name="url" type="string" indexed="true" stored="true"/>

Example: I'm searching for "aacsb" and I have two results, which is
correct. One is in English and one in German. I want to filter them out and
show only the German result.

My urls looks like this:

 https://www.myWebsite.com/aacsb-dog-lion?german
https://www.myWebsite.com/aacsb-dog-lion?english

Here are my queries:

http://localhost:8983/solr/myCore/suggest?&q=aacsb&suggest.dictionary=AnalyzingInfixSuggester&suggest.cfq=-url:english
http://localhost:8983/solr/myCore/suggest?&q=aacsb&suggest.dictionary=AnalyzingInfixSuggester&suggest.cfq=-english

With these I'm receiving both results. It doesn't matter if we have the
field name or not.

When I tried these

http://localhost:8983/solr/myCore/suggest?&q=aacsb&suggest.dictionary=AnalyzingInfixSuggester&suggest.cfq=url:\*english\*
http://localhost:8983/solr/myCore/suggest?&q=aacsb&suggest.dictionary=AnalyzingInfixSuggester&suggest.cfq=\*english\*

I don't receive any results.

I read the documentation several times: LINK
<https://lucene.apache.org/solr/guide/7_7/suggester.html#context-filtering>,
but I still can't make it work.

Any help is welcomed.

Best Regards,

Victor

Reply via email to