Solr
  1. Solr
  2. SOLR-5167

Ability to use AnalyzingInfixSuggester in Solr

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.6, Trunk
    • 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

        Varun Thacker created issue -
        Hide
        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
        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
        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
        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.
        Varun Thacker made changes -
        Field Original Value New Value
        Attachment SOLR-5167.patch [ 12598428 ]
        Hide
        Areek Zillur added a comment -

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

        Show
        Areek Zillur added a comment - Proper way to use AnalzingInfixSuggester in Solr + tests for the new LookupFactory
        Areek Zillur made changes -
        Attachment SOLR-5167.patch [ 12603113 ]
        Hide
        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 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
        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
        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
        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
        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
        Robert Muir added a comment -

        Thanks Varun and Areek!

        Show
        Robert Muir added a comment - Thanks Varun and Areek!
        Robert Muir made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 4.6 [ 12325000 ]
        Fix Version/s 4.5 [ 12324743 ]
        Resolution Fixed [ 1 ]
        Hide
        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 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
        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
        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!
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        30d 5h 2m 1 Robert Muir 15/Sep/13 17:35

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development