Victor Bonchevski created SOLR-14780:
----------------------------------------

             Summary: Solr Server Context Filtering in Auto Suggester not 
working
                 Key: SOLR-14780
                 URL: https://issues.apache.org/jira/browse/SOLR-14780
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: search
    Affects Versions: 7.7
            Reporter: Victor Bonchevski


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:


{code:java}
 <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>

{code}

Here are the fields in my schema:

 
{code:java}
<field name="main_title" type="string" indexed="true" stored="true"/>
 <field name="url" type="string" indexed="true" stored="true"/>
{code}


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:


{code:java}
 https://www.myWebsite.com/aacsb-dog-lion?german
 https://www.myWebsite.com/aacsb-dog-lion?english
{code}


Here are my queries:


{code:java}
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
{code}

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

When I tried these


{code:java}
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\*
{code}

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.

Thanks!






--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to