You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2014/03/16 05:51:51 UTC

[jira] [Updated] (SOLR-5683) Documentation of Suggester V2

     [ https://issues.apache.org/jira/browse/SOLR-5683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley updated SOLR-5683:
-------------------------------

    Fix Version/s:     (was: 4.7)
                   4.8

> Documentation of Suggester V2
> -----------------------------
>
>                 Key: SOLR-5683
>                 URL: https://issues.apache.org/jira/browse/SOLR-5683
>             Project: Solr
>          Issue Type: Task
>          Components: SearchComponents - other
>            Reporter: Areek Zillur
>            Assignee: Areek Zillur
>             Fix For: 4.8, 5.0
>
>
> Place holder for documentation that will eventually end up in the Solr Ref guide.
> ====
> The new Suggester Component allows Solr to fully utilize the Lucene suggesters. 
> The main features are:
> - lookup pluggability (TODO: add description):
>   -- AnalyzingInfixLookupFactory
>   -- AnalyzingLookupFactory
>   -- FuzzyLookupFactory
>   -- FreeTextLookupFactory
>   -- FSTLookupFactory
>   -- WFSTLookupFactory
>   -- TSTLookupFactory
>   --  JaspellLookupFactory
>    - Dictionary pluggability (give users the option to choose the dictionary implementation to use for their suggesters to consume)
>    -- Input from search index
>       --- DocumentDictionaryFactory – user can specify suggestion field along with optional weight and payload fields from their search index.
>       --- DocumentExpressionFactory – same as DocumentDictionaryFactory but allows users to specify arbitrary expression using existing numeric fields.
>      --- HighFrequencyDictionaryFactory – user can specify a suggestion field and specify a threshold to prune out less frequent terms.	
>    -- Input from external files
>      --- FileDictionaryFactory – user can specify a file which contains suggest entries, along with optional weights and payloads.
> Config (index time) options:
>   - name - name of suggester
>   - sourceLocation - external file location (for file-based suggesters)
>   - lookupImpl - type of lookup to use [default JaspellLookupFactory]
>   - dictionaryImpl - type of dictionary to use (lookup input) [default
>     (sourceLocation == null ? HighFrequencyDictionaryFactory : FileDictionaryFactory)]
>   - storeDir - location to store in-memory data structure in disk
>   - buildOnCommit - command to build suggester for every commit
>   - buildOnOptimize - command to build suggester for every optimize
> Query time options:
>   - suggest.dictionary - name of suggester to use (can occur multiple times for batching suggester requests)
>   - suggest.count - number of suggestions to return
>   - suggest.q - query to use for lookup
>   - suggest.build - command to build the suggester
>   - suggest.reload - command to reload the suggester
>   - buildAll – command to build all suggesters in the component
>   - reloadAll – command to reload all suggesters in the component
> Example query:
> {code}
> http://localhost:8983/solr/suggest?suggest.dictionary=suggester1&suggest=true&suggest.build=true&suggest.q=elec
> {code}
> Distributed query:
> {code}
> http://localhost:7574/solr/suggest?suggest.dictionary=suggester2&suggest=true&suggest.build=true&suggest.q=elec&shards=localhost:8983/solr,localhost:7574/solr&shards.qt=/suggest
> {code}	
> Response Format:
> The response format can be either XML or JSON. The typical response structure is as follows:
>  {code}
> {
>   suggest: {
>     suggester_name: {
>        suggest_query: { numFound:  .., suggestions: [ {term: .., weight: .., payload: ..}, .. ]} 
>    }
> }	
> {code}
>   
> Example Response:
> {code}
> {
>     responseHeader: {
>         status: 0,
>         QTime: 3
>     },
>     suggest: {
>         suggester1: {
>             e: {
>                 numFound: 1,
>                 suggestions: [
>                     {
>                         term: "electronics and computer1",
>                         weight: 100,
>                         payload: ""
>                     }
>                 ]
>             }
>         },
>         suggester2: {
>             e: {
>                 numFound: 1,
>                 suggestions: [
>                     {
>                         term: "electronics and computer1",
>                         weight: 10,
>                         payload: ""
>                     }
>                 ]
>             }
>         }
>     }
> }
> {code}
> Example solrconfig snippet with multiple suggester configuration:
> {code}  
>   <searchComponent name="suggest" class="solr.SuggestComponent">
>     <lst name="suggester">
>       <str name="name">suggester1</str>
>       <str name="lookupImpl">FuzzyLookupFactory</str>      
>       <str name="dictionaryImpl">DocumentDictionaryFactory</str>      
>       <str name="field">cat</str>
>       <str name="weightField">price</str>
>       <str name="suggestAnalyzerFieldType">string</str>
>     </lst>
>    <lst name="suggester">
>         <str name="name">suggester2 </str>
>         <str name="dictionaryImpl">DocumentExpressionDictionaryFactory</str>
>         <str name="lookupImpl">FuzzyLookupFactory</str>
>         <str name="field">product_name</str>
>         <str name="weightExpression">((price * 2) + ln(popularity))</str>
>         <str name="sortField">weight</str>
>         <str name="sortField">price</str>
>         <str name="strtoreDir">suggest_fuzzy_doc_expr_dict</str>
>         <str name="suggestAnalyzerFieldType">text</str>
>       </lst>  
> </searchComponent>
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org