0

My index consists of documents that can contain a field named rei. I currently have a suggester setup with the following config:

<lst name="suggester">
    <str name="name">contSuggester</str>
    <str name="lookupImpl">AnalyzingInfixLookupFactory</str>
    <str name="dictionaryImpl">DocumentDictionaryFactory</str>
    <str name="suggestAnalyzerFieldType">text_suggest</str>
    <str name="buildOnCommit">true</str>
    <str name="buildOnOptimize">true</str>
    <str name="buildOnStartup">true</str>
    <str name="field">contrat_lib_s_sugg</str>
    <str name="contextField">rei</str>
    <str name="highlight">false</str>
</lst>

I'm trying to filter out suggestions based on that rei field. I only want to get suggestions from documents that either contain the value "CA1701", or don't have that rei field at all.

To my knowledge, you can't use a filter query for the /suggest component. I'm using the contextField for this purpose, but I can't seem to find the solution.

I know how to do this using a filter query:

rei:CA1701 OR (*:* NOT rei:[* TO *])

but I can't translate it in the suggest.cfq syntax, as I can't specify the field name. The following query only gives me suggestions from documents that contain the value "CA1701" inside the rei field:

/suggest.q=super&suggest.dictionary=contSuggester&suggest.cfq=CA1701
cdaveau
  • 129
  • 1
  • 7

0 Answers0