Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5167

Ability to use AnalyzingInfixSuggester in Solr

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.6, 6.0
    • Labels:
      None

      Description

      We should be able to use AnalyzingInfixSuggester in Solr by defining it in solrconfig.xml

      1. SOLR-5167.patch
        19 kB
        Areek Zillur
      2. SOLR-5167.patch
        5 kB
        Varun Thacker

        Activity

        Hide
        varunthacker Varun Thacker added a comment -

        We could define it like:

        <searchComponent class="solr.SpellCheckComponent" name="suggest">
          <lst name="spellchecker">
            <str name="name">suggest</str>
            <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
            <str name="lookupImpl">org.apache.solr.spelling.suggest.AnalyzingInfixSuggester</str>
            <str name="field">name</str>  <!-- the indexed field to derive suggestions from -->
            <str name="buildOnCommit">true</str>
            <str name="storeDir">suggester</str>
            <str name="suggestAnalyzerFieldType">text_general</str>
            <str name="minPrefixChars">4</str>
          </lst>
        </searchComponent>
        
        Show
        varunthacker Varun Thacker added a comment - We could define it like: <searchComponent class="solr.SpellCheckComponent" name="suggest"> <lst name="spellchecker"> <str name="name">suggest</str> <str name="classname">org.apache.solr.spelling.suggest.Suggester</str> <str name="lookupImpl">org.apache.solr.spelling.suggest.AnalyzingInfixSuggester</str> <str name="field">name</str> <!-- the indexed field to derive suggestions from --> <str name="buildOnCommit">true</str> <str name="storeDir">suggester</str> <str name="suggestAnalyzerFieldType">text_general</str> <str name="minPrefixChars">4</str> </lst> </searchComponent>
        Hide
        varunthacker Varun Thacker added a comment -

        I have a few doubts over this impl.

        1. AnalyzingInfixSuggester.store() and AnalyzingInfixSuggester.load() return true instead of false. Not sure if this is the right?

        2. Suggester.reload() throws a FileNotFoundException since no file actually gets written. Any suggestions on what the right approach for this would be.

        Show
        varunthacker Varun Thacker added a comment - I have a few doubts over this impl. 1. AnalyzingInfixSuggester.store() and AnalyzingInfixSuggester.load() return true instead of false. Not sure if this is the right? 2. Suggester.reload() throws a FileNotFoundException since no file actually gets written. Any suggestions on what the right approach for this would be.
        Hide
        areek Areek Zillur added a comment -

        Proper way to use AnalzingInfixSuggester in Solr + tests for the new LookupFactory

        Show
        areek Areek Zillur added a comment - Proper way to use AnalzingInfixSuggester in Solr + tests for the new LookupFactory
        Hide
        areek Areek Zillur added a comment -

        To answer Varun's question, the storeDir parameter for the AnalyzingInfixSuggestions should be null, the reason being that this analyzer does not store the dictionary at the suggestor level, rather manages building and loading the index that gets created on its own. hence the store() and load() should return false (this is what gets used by the Suggester to load any persistent dictionary).

        Show
        areek Areek Zillur added a comment - To answer Varun's question, the storeDir parameter for the AnalyzingInfixSuggestions should be null, the reason being that this analyzer does not store the dictionary at the suggestor level, rather manages building and loading the index that gets created on its own. hence the store() and load() should return false (this is what gets used by the Suggester to load any persistent dictionary).
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1523451 from Robert Muir in branch 'dev/trunk'
        [ https://svn.apache.org/r1523451 ]

        SOLR-5167: Ability to use AnalyzingInfixSuggester in Solr

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1523451 from Robert Muir in branch 'dev/trunk' [ https://svn.apache.org/r1523451 ] SOLR-5167 : Ability to use AnalyzingInfixSuggester in Solr
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 1523454 from Robert Muir in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1523454 ]

        SOLR-5167: Ability to use AnalyzingInfixSuggester in Solr

        Show
        jira-bot ASF subversion and git services added a comment - Commit 1523454 from Robert Muir in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1523454 ] SOLR-5167 : Ability to use AnalyzingInfixSuggester in Solr
        Hide
        rcmuir Robert Muir added a comment -

        Thanks Varun and Areek!

        Show
        rcmuir Robert Muir added a comment - Thanks Varun and Areek!
        Hide
        arcadius Arcadius Ahouansou added a comment - - edited

        A quick question:
        Does this new AnalyzingInfixSuggester play well with NRT indexing? i.e does it pick up changes done via soft commit?

        Thanks.

        Show
        arcadius Arcadius Ahouansou added a comment - - edited A quick question: Does this new AnalyzingInfixSuggester play well with NRT indexing? i.e does it pick up changes done via soft commit? Thanks.
        Hide
        mikemccand Michael McCandless added a comment -

        Does this new AnalyzingInfixSuggester play well with NRT indexing?

        It doesn't right now, but that should be simple to fix since it's just a Lucene index under the hood... patches welcome!

        Show
        mikemccand Michael McCandless added a comment - Does this new AnalyzingInfixSuggester play well with NRT indexing? It doesn't right now, but that should be simple to fix since it's just a Lucene index under the hood... patches welcome!

          People

          • Assignee:
            Unassigned
            Reporter:
            varunthacker Varun Thacker
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development